-
Notifications
You must be signed in to change notification settings - Fork 413
Open
Description
Let suppose I have those 2 schemas
example-ref-schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"$id": "example-ref",
"properties": {
"_id": {
"type": "string"
},
"_key": {
"type": "string"
}
},
"required": ["_id", "_key"],
"additionalProperties": false
}
example.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"allOf": [
{
"$ref": "./example-ref-schema.json"
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": ["name"],
"additionalProperties": false
}
]
}
It produces the following output:
example-ref-schema.d.ts
export interface ExampleRef {
_id: string;
_key: string;
}
example.d.ts
export type Example = ExampleRef & {
name: string;
description?: string;
};
export interface ExampleRef {
_id: string;
_key: string;
}
Is it possible to:
- have the
ExampleRef
interface declared before theExampleWithArangoMetadata
type ? I would like to generate Typebox types from this but the order creates anThis variable is used before its declaration.
error. - Not having the
ExampleRef
interface from theschema.d.ts
(and other schema files) exported but only the one from theexample-ref-schema.d.ts
?
Metadata
Metadata
Assignees
Labels
No labels