You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the below definition, try to use one of the examples to send a request with the application/x-www-form-urlencoded type (grant_type=authorization_code&code=xxxxxxxxxx&client_id=xxxxxxxxxx) and see the request that is generating is separating out each individual character into a separate param in the body.
Example Swagger/OpenAPI definition:
openapi: 3.0.1info:
title: Test APIdescription: Testingversion: "1.0"servers:
- url: http://localhost:8080description: Generated server urlsecurity:
- api: []paths:
/v1/token:
post:
tags:
- token-controllerdescription: Oauth 2 Access Token.operationId: getOauthAccessTokenrequestBody:
content:
application/x-www-form-urlencoded:
schema:
type: objectexamples:
authorization_code grant type:
description: authorization_code grant typevalue: grant_type=authorization_code&code=xxxxxxxxxx&client_id=xxxxxxxxxxclient_credentials grant type:
description: client_credentials grant typevalue: grant_type=client_credentials&client_id=xxxxxxxxxx&client_secret=xxxxxxxxxxrefresh_token grant type:
description: refresh_token grant typevalue: grant_type=refresh_token&refresh_token=xxxxxxxxxxresponses:
'200':
description: OKcontent:
application/json:
schema:
$ref: '#/components/schemas/OauthAccessTokenResponseView_V1'components:
schemas:
OauthAccessTokenResponseView_V1:
type: objectproperties:
scope:
type: stringaccess_token:
type: stringrefresh_token:
type: stringtoken_type:
type: stringexpires_in:
type: integerformat: int64description: 'The Oauth 2 Access Token response: https://www.oauth.com/oauth2-servers/access-tokens/access-token-response/'securitySchemes:
api:
type: httpscheme: bearer
Describe the bug you're encountering
When entering in free-form form data, the request ends up being the below, note the body that is built.
I think just setting type: object is too wide, your form input should by restricted by the use of oneOf combined with schemas objects for each of your usecase (authorization_code grant type, client_credentials grant type and refresh_token grant type).
We have the same problem, using "oneOf" doesn't help. What interesting, on much older version of swagger ui (3.32.5) everything is working fine (multiple examples and application/x-www-form-urlencoded).
Q&A (please complete the following information)
Content & configuration
Using the below definition, try to use one of the examples to send a request with the application/x-www-form-urlencoded type (grant_type=authorization_code&code=xxxxxxxxxx&client_id=xxxxxxxxxx) and see the request that is generating is separating out each individual character into a separate param in the body.
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
When entering in free-form form data, the request ends up being the below, note the body that is built.
To reproduce...
Steps to reproduce the behavior:
Expected behavior
Request body should not be split apart into separate characters, should look like:"
According to the open api documentation, free form form data should work with just type object.
The text was updated successfully, but these errors were encountered: