Skip to content

Add support for more HTTP request methods under "UseDefinitions: true" in swagger generation #4998

Open
@Twilikiss

Description

@Twilikiss

Is your feature request related to a problem? Please describe.

Before that, please fix the Post Json processing logic bug in the swagger document generation operation. Related PR has been proposed.(#4997)

When I set 'UseDefinitions: true', which means' UseDefinitions' is enabled, the generated swagger json does not generate the Request Body defined in any requests other than POST requests. This doesn't make sense; the PUT and PATCH methods should also support Request bodies.(Even GET and DELETE, personally feel should not be limited here, these should be the interface design considerations.)

Also, when 'UseDefinitions: true' is disabled, the Request Body is parsed and displayed. This parameter is described in 'example.api'

”if set true, the definitions will be generated in the swagger.json for response body or json request body file, and the models will be referenced in the API”

I don't quite understand why changing one configuration affects which HTTP methods are supported, and neither example.api nor the corresponding README makes the difference clear.

Let's take 'example.api' as an example:

Image Image

Describe the solution you'd like
Support all methods that should have a request body

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions