We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
properties
oneOf
1 parent e382efa commit 814c96bCopy full SHA for 814c96b
tests/schema.test.ts
@@ -173,6 +173,23 @@ describe("SchemaObject", () => {
173
})
174
).toBe(`{ [key: string]: (string) | (number) | (boolean); }`);
175
});
176
+
177
+ // https://www.jsonschemavalidator.net/s/fOyR2UtQ
178
+ it("properties + oneOf", () => {
179
+ expect(
180
+ transform({
181
+ properties: {
182
+ a: {
183
+ type: "string",
184
+ },
185
186
+ anyOf: [
187
+ { properties: { b: { type: "string" } }, required: ["b"] },
188
+ { properties: { c: { type: "string" } }, required: ["c"] },
189
+ ],
190
+ })
191
+ ).toBe(`{"a"?: string;} & (Partial<{"b": string;}>) & (Partial<{"c": string;}>)`);
192
+ });
193
194
195
describe("comments", () => {
0 commit comments