Skip to content

Commit

Permalink
fix: handle definitions from xdl schema properly (#25)
Browse files Browse the repository at this point in the history
* chore: update the schema definitions to latest version

* fix: place definitions to the root of the schema
  • Loading branch information
byCedric authored Sep 30, 2020
1 parent a6df107 commit 7afdc86
Show file tree
Hide file tree
Showing 4 changed files with 542 additions and 996 deletions.
8 changes: 8 additions & 0 deletions src/manifest/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type ManifestSchema = {
version: string;
additionalProperties: true;
required: string[];
definitions?: any;
properties: {
expo: any;
};
Expand Down Expand Up @@ -48,12 +49,19 @@ export function createFromXdl(sdkVersion: string, xdlSchema: JsonSchema): Manife
enhancedSchema = xdlSchema;
}

// note: we need to move over definitions from the schema and put them into root
const { definitions } = enhancedSchema;
if (definitions) {
delete enhancedSchema.definitions;
}

return {
$schema: 'http://json-schema.org/draft-07/schema#',
type: 'object',
version: sdkVersion,
additionalProperties: true,
required: ['expo'],
definitions,
properties: {
expo: enhancedSchema,
},
Expand Down
Loading

0 comments on commit 7afdc86

Please sign in to comment.