fastify-swagger icon indicating copy to clipboard operation
fastify-swagger copied to clipboard

support head routes #648

Open buschco opened this issue 3 years ago • 6 comments

Checklist

  • [x] run npm run test
  • [ ] and npm run benchmark (npm ERR! Missing script: "benchmark")
  • [x] tests and/or benchmarks are included
  • [ ] documentation is changed or added (tell me where it is necessary)
  • [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct

buschco avatar Aug 07 '22 13:08 buschco

Run npm run lint and fix the linting issues.

Uzlopak avatar Aug 07 '22 14:08 Uzlopak

@Uzlopak could you please have another look?

buschco avatar Aug 07 '22 16:08 buschco

@Fdawgs I think @climba03003 has a point. It should be maybe implemented differently.

Uzlopak avatar Aug 11 '22 06:08 Uzlopak

Any update on this one? cc @climba03003

mcollina avatar Aug 19 '22 09:08 mcollina

Any update on this one?

It's not updated based on my comment. The current approach is error-prone and not good for maintenance.

climba03003 avatar Aug 19 '22 10:08 climba03003

sorry i was on vacation I will submit a updated version in the coming week 🤞

buschco avatar Aug 29 '22 06:08 buschco

So I just pushed a new approach: As I described here https://github.com/fastify/fastify-swagger/issues/648#issuecomment-1207410705 the problem is a duplicate operationId. My solution now, suffixes HEAD routes that have an operationId while any of exposeHeadRoutes or exposeHeadRoute is true. Also if the flag is set, and the user trys to add a custom HEAD route any way, fastify already warns the user: https://github.com/fastify/fastify/blob/main/lib/route.js#L358-L360

buschco avatar Oct 09 '22 10:10 buschco

@climba03003 PTAL

Uzlopak avatar Oct 09 '22 19:10 Uzlopak

@Uzlopak @climba03003 ptal

mcollina avatar Oct 12 '22 21:10 mcollina

@Eomm PTAL

mcollina avatar Oct 16 '22 17:10 mcollina

Hi all, any update on this PR? It needs some changes? We also need the openapi of the HEAD methods, which at the moment is totally skipped. Can I help to unblock this in some way?

davidebianchi avatar May 15 '23 10:05 davidebianchi

I think this can land

mcollina avatar May 15 '23 12:05 mcollina