swagger-ui: Requestbody x-www-form-urlencoded is not properly rendered
Q&A (please complete the following information)
- OS: windows
- Browser: chrome
- Version: 67
- Method of installation: dist
- Swagger-UI version: 3.17.0
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Swagger/OpenAPI definition:
requestBody:
description: user info to be filled
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- username
- name
properties:
username:
type: string
description: user identity
name:
type: string
description: user name
phone_number:
type: string
pattern: '/\d{11}/'
description: phone number
Swagger-UI configuration options:
SwaggerUI({
// your config options here
})
?yourQueryStringConfig
Is your feature request related to a problem?
- property descriptions are not shown
- required properties are not starred
- required properties checking, string regex pattern checking is not performed when try swagger client
However, parameters are ideally shown. There should be no much difference between parameters and body form data.
Describe the solution you’d like
Describe alternatives you’ve considered
Additional context
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 21 (7 by maintainers)
This has been prioritized, and will be fixed shortly 😄
@danielflower the default value issue is fixed since https://github.com/swagger-api/swagger-ui/commit/8f65483510770ef548ea7a79d9e5ba9a3387dcee#diff-47300e7ecd8989b6246221de88fc9a3cR633
The re-appear issue is definitely a bug.
Works great now. Thanks a lot!
@shockey, not yet. I saw the release notes, and plan to upgrade to the latest. Thank you.
@arlix85 In OpenAPI 3.0, required is not suitable for properties, there’s a required array for properties, like
Thanks.
Hello, I was about to open a new issue but I’ve seen this one which is correlated. I would like to integrate Ispvic report with the object-level “example” (as documented here https://swagger.io/docs/specification/adding-examples/#request-response-bodies) which doesn’t seem to be supported:
Plus, the example is still populated by using the notation inside the properties…
…but in the form the example is always rendered between quotation marks:
If something is wrong on my YAML code, please let me know, I wasn’t able to correct the issue even with different notations.
Thanks, Fabio