I have an endpoint setup with polymorphic types.
In the generated swagger.json, the polymorphism is described as follows:
"oneOf": [
{ "$ref": "#/components/schemas/SchemaA" },
{ "$ref": "#/components/schemas/SchemaB" },
...
],
"discriminator": {
"propertyName": "$type",
"mapping": {
"identifier1": "#/components/schemas/SchemaA",
"identifier2": "#/components/schemas/SchemaB",
...
}
}
Thus:
The payload includes a $type property to identify the actual type.
Each $type maps to a specific schema reference under components/schemas.
Problem
When calling the endpoint via ApiDog (with a valid response payload including $type), the ApiDog validation fails.
The reported errors are:
“Additional properties not allowed”
“Missing required properties”
These errors occur even though:
The response payload matches the expected polymorphic type based on $type.
The Swagger/OpenAPI definition has the correct discriminator and oneOf entries.