Closed
Description
Have a look at: https://github.com/darcyparker/json-schema-to-typescript/blob/fe3f08f1d7eb4445619488974f9f89b2353b74c7/test/cases/allOf.ts
As a comparison, dtsgenerator creates this output:
export interface Itest {
fooAndBar: {
a: string;
b: number;
};
foo: {
a: string;
b: number;
};
more: {
a: string;
};
}
declare namespace Itest {
namespace Definitions {
export interface Bar {
a: string;
}
export interface Foo {
a: string;
b: number;
}
}
}
Notes:
- ignore the interface name and namespace
Itest
...:dtgenerator
uses the filename rather than thetitle
of the schema.- I like
json-schema-typescript
's compiler's choice to use the definitions ofBar
andFoo
inItest
. but ignoring this, you can see it picks up the properties insideallOf
that is a sibling of the top levelproperties
. I believe this is correct behavior becauseajv compile -s test.json -o test.js
creates a validator that checks formore
.