fastify / fastify-swagger

Swagger documentation generator for Fastify
MIT License
910 stars 200 forks source link

adds endpoint-specific transforms #752

Closed thorhj closed 1 year ago

thorhj commented 1 year ago

Addressing #749

Checklist

thorhj commented 1 year ago

Two considerations for the reviewer:

  1. The property for the transform function is called swaggerTransform but supports both OpenAPI and Swagger specs of course. Don't know if that is confusion and a better name should be added (or two separate properties).
  2. The implementation allows the swaggerTransform to be given the value null which has its own specific meaning. Maybe this should be the string literal "disable" or something else to be more clear.
thorhj commented 1 year ago

missing typing tests.

Added some tests in types.test.ts. Let me know if they should be written differently, haven't made such tests before (I'm usually working in Typescript directly 😉)

thorhj commented 1 year ago

I reviewed it now.

swggerTransform null is quiet unintuitive. I would personally prefer false for deactivating.

I agree, changed it to false instead of null.

fredrikj31 commented 1 year ago

When is this set to be released? 🤔

mcollina commented 1 year ago

done now