fastify-type-provider-zod icon indicating copy to clipboard operation
fastify-type-provider-zod copied to clipboard

How to specify examples?

Open JaneJeon opened this issue 1 year ago • 2 comments

For use with fastify-swagger, I'd like to be able to add examples at the property level and at the schema level.

From reading the code, it seems like this library just pipes the output from https://github.com/StefanTerdell/zod-to-json-schema, but that library only concerns itself with json schema, not OpenAPI, so it wouldn't even be in scope for that library to emit examples.

So how would I go about adding example property/schema here? if it's not possible, what needs to be changed/added?

Thanks

JaneJeon avatar May 28 '23 19:05 JaneJeon

It depends on this I guess

https://github.com/colinhacks/zod/pull/2549

maktouch avatar Oct 17 '23 14:10 maktouch

As an update: colinhacks rejected the PR and is working on a RFC to solve the metadata issue.

matthiasbaldi avatar Apr 22 '24 09:04 matthiasbaldi