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

supportedSubmitMethods option missing from type SwaggerOptions.uiConfig in index.d.ts

Open roeeyud opened this issue 3 years ago • 2 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.1.0 and 5.2.0

Plugin version

No response

Node.js version

16.15.0

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

11

Description

Working with typescript export type SwaggerOptions from file index.d.ts is missing supportedSubmitMethods: Array<string>

This field is useful to remove the "Try it out" Button entirely or only for specific methods See https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/ for more details

Thank you so much for all the effort you put in ❤️

Steps to Reproduce

While coding simply try to add the following uiConfig object to SwaggerOptions

 uiConfig: {
    supportedSubmitMethods: [],
    docExpansion: "full",
    deepLinking: false,
  },

Expected Behavior

Typescript should recognize supportedSubmitMethods, if you add // @ts-ignore the field actually works

roeeyud avatar Jun 28 '22 12:06 roeeyud

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

mcollina avatar Jun 28 '22 13:06 mcollina

No way I can say no to the great Matteo ! It will be an honor 😃 Should be ready in a day or two

roeeyud avatar Jun 28 '22 15:06 roeeyud