openapi-sampler
openapi-sampler copied to clipboard
`required` not handled in `oneOf` clause
See reproduced example here: https://codesandbox.io/p/sandbox/openapi-sampler-oneof-bug-ignfcs
I have the following schema:
{
type: "object",
properties: {
a: {
type: "string",
},
b: {
type: "string",
},
},
oneOf: [
{
required: ["a"],
},
{
required: ["b"],
},
],
};
Since either a
is required or b
is required I would expect {a: "string"}
or {b: "string"}
to be correct examples for this schema.
openapi-sampler
produces {a: "string", b: "string"}
as an example which is incorrect. The error given by asyncapi parser is must match exactly one schema in oneOf
.
If I add the {skipNonRequired: true}
option then the example becomes {}
which is also incorrect.