eropple / fastify-openapi3

Developer-friendly OpenAPI3 tooling for Fastify that's easy to use.
23 stars 2 forks source link

Type error when response schemas are nested #6

Closed eropple closed 10 months ago

eropple commented 10 months ago

Response schemas don't currently permit nested objects because they're not expecting the possibility of a nested $ref. This should be rare (your schemas should be unpacked!) but it seems technically legal.

eropple commented 10 months ago

Fixing this is going to require breaking API compatibility. SchemaObject is the wrong thing here; we're all-in on typebox, so this should be TSchema & TaggedSchema (to also remove a potential failure from passing an object not wrapped by schemaType anyway).