-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated requestBody
restores to example after closing endpoint view and openning again
#6817
Comments
Currently analyzing this issue. Actually this was introduced by #6518 (3905fad) in v3.35.2. swagger-ui/src/core/components/parameters/parameters.jsx Lines 80 to 93 in 3905fad
This is because of specSelectors.isMediaTypeSchemaPropertiesEqual does not take into account that incase of currentMediaType and targetMediaType are the same it should return true.swagger-ui/src/core/plugins/spec/selectors.js Lines 517 to 526 in 3905fad
Going to fix this via PR by adding following check: export const isMediaTypeSchemaPropertiesEqual = ( state, pathMethod, currentMediaType, targetMediaType) => {
if((currentMediaType || targetMediaType) && currentMediaType === targetMediaType ) {
return true
} |
@mathis-m thanks for the quick response. Sorry for wrong assumptions about the root cause. |
@yarsanich Thank you for leading me in the right direction and for reporting this issue! |
Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
Updated value in
requestBody
is cleared after closing endpoint.To reproduce...
Steps to reproduce the behavior:
Expected behavior
The updated value should be present after closing and opening endpoint
Screenshots
swagger-ui-bug.mov
Additional context or thoughts
After adding one more supported schema to
requestBody.contents
for exampleapplication/xml
. The updated value is still present after closing and opening again.swagger.ui.bug.workaround.mov
After small investigation(downgrading from 3.39.0 to 3.35.0 gradually) an issue was found in 3.35.1
After code check the possible issue might be in next changes:
parameter-row: rendering of default/example values of 0 (fix(parameter-row): rendering of default/example values of 0 #6454) (797929f)
examples multipart array sample generation for items (Fix multipart array sample generation for items. #6461) (f4bdf2f)
The text was updated successfully, but these errors were encountered: