Open cgearing opened 4 months ago
It would be fairly easy to provide support for unions in the validator:
e.g
@api.post("/building") @spec_api.validate(body=Apartment | House, resp=Response(HTTP_200=SuccessModel)) def create_building() -> Any: building = request.context.body ...
We could probably follow the approach taken by FastAPI and generate a temporary schema for the OpenAPI docs that just concatenates the name of the inputs together:
"schema": { "anyOf": [ { "$ref": "#/components/schemas/Apartment" }, { "$ref": "#/components/schemas/House" }, ], "title": "ApartmentHouseUnion" }
It would be fairly easy to provide support for unions in the validator:
e.g
We could probably follow the approach taken by FastAPI and generate a temporary schema for the OpenAPI docs that just concatenates the name of the inputs together: