Open zAlweNy26 opened 5 months ago
Hey there! Thanks for using the plugin! I wasn't sure anyone was using this apart from my teams internally.
The idea behind this rule is to ensure mostly that all fields have a description, but the easiest way to do that is by enforcing firstly that .openapi is added to all fields. I'm not sure what renderer you normally use but on redoc it can be quite ugly when a description is missing. Eg.
Hi, thanks for the response. I'm using this plugin in combination with zod-openapi
, fastify-zod-openapi
, @fastify/swagger
and @fastify/swagger-ui
. I was just wondering if it would make sense to have the .openapi
method both on the object and its properties. In my opinion, the plugin should check and throw an error only if both don't have one.
For example:
.openapi
in the ZodObject, then its keys should not require the method..openapi
method, then the object should not ask for the method.Tell me what you think, I don't think it would break any current setup you or others have.
I think it would have to be a configurable option, as we currently use it to ensure every field has an .openapi field. Including objects and their lower fields
Yeah I agree
Hi, I don't know if it's the right thing to do or not, but I think this plugin should not throw an error to every key of a zod object if the object itself has the
.openapi
method declared. For example: This should not occur in my opinion. Let me know what you think!