Request bodies with different schemas and content types within one operation don't update data entry correctly
#5872 aperta il 21 feb 2020
Metriche repository
- Star
- (25.447 star)
- Metriche merge PR
- (Merge medio 20h 34m) (14 PR mergiate in 30 g)
Descrizione
Q&A (please complete the following information)
- OS: Windows 10
- Browser: Chrome
- Version: 79.0.3945.130 (Official Build) (64-bit)
- Method of installation:
https://unpkg.com/swagger-ui-dist/ - Swagger-UI version: 3.25.0
- Swagger/OpenAPI version: OpenAPI 3
Content & configuration
Minimal Example - https://keyz182.github.io/swagger_ui_bug/ SwaggerUI Init - https://github.com/keyz182/swagger_ui_bug/blob/9503ca4b04e9319536392229be641df915fb606a/index.html#L41 OpenAPI Yaml - https://github.com/keyz182/swagger_ui_bug/blob/master/openapi.yaml
Describe the bug you're encountering
When changing between request body content types, non form based bodies get stuck on the last one to be selected.
To reproduce...
-
Open the example linked above
-
Change the content type before clicking try, then change back, all works as expected.
-
Click try
-
Change content type - Note that it doesn't match the Yaml
-
Change to a form type - works correctly
-
Change to a non form type - works correctly
-
Change to another non form type - not working correctly
Expected behavior
The editable request body box should show the appropriate content.
Additional context or thoughts
We have different schemas for different content types to support JSON API, along with other types. JSON API requires a very specific body type.
May be related to #3448 as it can manifest in an apparently similar manner, though selecting XML first does actually show XML.