Skip to content

Commit 1a55a39

Browse files
committed
Add pre-processing script to enable all our code generation tools to work with $refs
The root problem is that our TS-type-generation tool, jsonschema-to-typescript, expects $ref paths to be relative to the schema root directory, while our Python-type-generation tool, datamodel-codegen, expects $ref paths to be relative to the file containing the $ref. To work around this, I'm adding a pre-processing step to the Python type generation code which converts the paths to look like datamodel-codegen expects.
1 parent 11c77d8 commit 1a55a39

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/schema/src/schema/project/layers/symbology/vectorColor.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
},
1111
"selectedAttribute": {
1212
"type": "string",
13-
"title": "Attribute",
1413
"description": "The selected attribute for varying the color"
1514
},
1615
"colorRamp": {

packages/schema/src/schema/project/layers/vectorLayer.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@
1919
},
2020
"symbology": {
2121
"type": "object",
22-
"description": "The user inputs for symbology options"
22+
"description": "The user inputs for symbology options",
23+
"additionalProperties": false,
24+
"properties": {
25+
"color": {
26+
"$ref": "project/layers/symbology/vectorColor.json"
27+
},
28+
"size": {
29+
"$ref": "project/layers/symbology/vectorSize.json"
30+
}
31+
}
2332
}
2433
}
2534
}

0 commit comments

Comments
 (0)