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
In Swagger UI, when using AnyOf variables that can be null and have a default value of null, the input fields are incorrectly populated with the string "null" after clicking “Try it out.” Additionally, the “Send empty value” checkbox remains unchecked.
If the request is sent via “Execute” without modifying the fields, Swagger UI submits the string values "null", even though the schema defines them as Integer | null:
When the default value is explicitly set to null:
• The “Send empty value” checkbox should be checked by default.
• The input fields should be empty, displaying only the placeholder text.
Currently, Swagger UI misinterprets null as a literal string, leading to incorrect behavior. This should not be the intended default behavior and appears to be a bug.
Q&A
Example Swagger/OpenAPI definition:
Swagger-UI configuration options:
noting, just use https://editor-next.swagger.io for reproduce.
Describe the bug you're encountering
In Swagger UI, when using AnyOf variables that can be null and have a default value of null, the input fields are incorrectly populated with the string "null" after clicking “Try it out.” Additionally, the “Send empty value” checkbox remains unchecked.
If the request is sent via “Execute” without modifying the fields, Swagger UI submits the string values "null", even though the schema defines them as Integer | null:
To reproduce...
Steps to reproduce the behavior:
name
,digit
Expected behavior
When the default value is explicitly set to null:
• The “Send empty value” checkbox should be checked by default.
• The input fields should be empty, displaying only the placeholder text.
Currently, Swagger UI misinterprets null as a literal string, leading to incorrect behavior. This should not be the intended default behavior and appears to be a bug.
Immediately click on
Execute
should perform:Screenshots
actual behavior in the UI after click on
try out
:expected behavior in the UI after click on
try out
:The text was updated successfully, but these errors were encountered: