You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual behavior
When submitting the following request body:
{ "prop1": "a value", "prop3": "another value" }
Error: request/body must NOT have additional properties, request/body must NOT have additional properties, request/body must NOT have additional properties, request/body must match exactly one schema in oneOf, request/body must NOT have additional properties, request/body must NOT have additional properties, request/body must NOT have additional properties
Expected behavior
I would expect that request to be validated OK by that schema.
Additional information
The intent here is to have a schema that allows sending either prop1 and prop3 or prop2 and prop3
This is what I see in the OpenAPI SwaggerUI preview window (in VSCode), which looks OK:
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RequestDTO = (
| {
prop1?: string;
}
| {
prop2?: RequestDTO.prop2;
}
) & {
prop3?: string;
};
export namespace RequestDTO {
export enum prop2 {
THIS = "this",
THAT = "that",
}
}
Am I assuming something wrong about how my schema should behave with this input?
The text was updated successfully, but these errors were encountered:
jmechevarria
changed the title
Schema is marked as invalid, using oneOf inside allOf
Request body is marked as invalid, using oneOf inside allOfFeb 7, 2024
Describe the bug
I try to use
oneOf
insideallOf
in my schema, but validator says request body is invalidTo Reproduce
This is the schema:
Actual behavior
When submitting the following request body:
Error:
request/body must NOT have additional properties, request/body must NOT have additional properties, request/body must NOT have additional properties, request/body must match exactly one schema in oneOf, request/body must NOT have additional properties, request/body must NOT have additional properties, request/body must NOT have additional properties
Expected behavior
I would expect that request to be validated OK by that schema.
Additional information
The intent here is to have a schema that allows sending either
prop1
andprop3
orprop2
andprop3
This is what I see in the OpenAPI SwaggerUI preview window (in VSCode), which looks OK:
Also, I'm using openapi-typescript-codegen to generate my TS clients and that also looks OK:
Am I assuming something wrong about how my schema should behave with this input?
The text was updated successfully, but these errors were encountered: