"application/x-www-form-urlencoded" to add to operation_request_body_types in service_generator.py
Content-type "API application/x-www-form-urlencoded" is required for Access Token Request see RFC6749 (The OAuth 2.0 Authorization Framework) section 4.4.2 "Access Token Request"
Could you please add this content-type to operation_request_body_types in service_generator.py like below ?
operation_request_body_types = [
"application/json",
"text/plain",
"multipart/form-data",
"application/x-www-form-urlencoded"
]
Thank you for your help !
Hi there :) Sorry, i won't have much time currently. I'll gladly accept a PR though :)
For anyone curious about the error message Exception: Unsupported request body type: <class 'openapi_schema_pydantic.v3.v????.request_body.RequestBody'>, this is the reason. Simply adding this to the list of operation_request_body_types does not appear to fix the issue, as the generated client still tries to set the Content-Type to application/json.
We use openapi-python-generator package mainly for the models part. So of course, we had to correct in the services part the operation related to "OAUTH2 Get token" in order to have the good content-type. The change on service_generator.py is not enough even it unblock generation of models part. It could be completed by an issue on openapi_schema_pydantic package in order to added "application/x-www-form-urlencoded" on Content-type.