question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extra (unnecessary?) type generated when processing url encoded body swagger

See original GitHub issue

Describe the bug

In this PR we found an extra type/class was generated:

Paths14Hl8BdFormsdataurlencodedPetAddPetidPostRequestbodyContentApplicationXWwwFormUrlencodedSchema

This was a minor annoyance for .NET, as we mark it internal, but might be more annoying for other languages.

Swagger Generated File

Expected behavior @pakrym and I expected this type to be not added.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
timotheeguerincommented, Feb 22, 2021

As far as I understand in OpenApi3. You have a single entry for the schema requestbody and then you can define the schema per content type

https://swagger.io/docs/specification/describing-request-body/

paths:
  /survey:
    post:
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                name:          # <!--- form field name
                  type: string
                fav_number:    # <!--- form field name
                  type: integer
              required:
                - name
                - email
0reactions
pakrymcommented, Feb 22, 2021

TIL. thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenAPI Specification - Version 3.0.3 - Swagger
It is RECOMMENDED that the root OpenAPI document be named: openapi.json or openapi.yaml . Data Types. Primitive data types in the OAS are...
Read more >
Requestbody x-www-form-urlencoded is not properly rendered
The input value is set to string only once when clicked the "Try it out" button. In this case we should use a...
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface description for HTTP APIs.
Read more >
Swagger java annotations in action - ITNEXT
The output is a swagger definition file, it can be used then to generate client/server ... path parameters, or parsing/encoding the request/response body....
Read more >
Generate Server Code Using OpenAPI Generator
This will give you immediate feedback whether your specification has errors and it generates the Swagger documentation on the fly. More ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found