4 ms·
Do it like OpenAPI does. Separate structure from properties and type. And if you want a fixed value your type is a value. That way you don't mix the JSONSchem
by WirelessGigabit 4y ago
Do it like OpenAPI does.
Separate structure from properties and type. And if you want a fixed value your type is a value.
That way you don't mix the JSONSchema's schema is separate from the thing you're describing.
- EdwardDiego 4y agoDoes OpenAPI support union types yet? More importantly, if it does, does Swagger support the OpenAPI version that does?
- andreareina 4y agoWe have union types defined in fastapi/pydantic and they do show up in the api explorer. Tagged unions don't work but I think that's more to do with us/python than openapi.
- EdwardDiego 4y agoAh, that's nice. I think a year or so ago I was dealing with api docs that'd been run through Swagger and it just stopped emitting fields when it hit union types.