Q&A (please complete the following information)
- OS: [e.g. macOS]
- Browser: [e.g. chrome, safari]
- Version: [e.g. 22]
- Method of installation: [e.g. npm, dist assets]
- Swagger-UI version: [e.g. 3.10.0]
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]
OAS 3.1, Swagger UI 5.31.2
Content & configuration
Swagger/OpenAPI definition:
Swagger-UI configuration options:
SwaggerUI({
// your config options here
})
What FastAPI+Pydantic provides, but with vendored assets
Screenshots
How can we help?
I have
"success": {
"type": "boolean",
"title": "Success",
"default": false
},
But I would like the rendered default to be null - even if the type of the argument is success: bool (or, at least with success: bool | None = None (PS: Python)
IIUC, partially of the code responsible is here
|
const primitives = { |
|
"string": () => "string", |
|
"string_email": () => "user@example.com", |
|
"string_date-time": () => new Date().toISOString(), |
|
"string_date": () => new Date().toISOString().substring(0, 10), |
|
"string_uuid": () => "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|
"string_hostname": () => "example.com", |
|
"string_ipv4": () => "198.51.100.42", |
|
"string_ipv6": () => "2001:0db8:5b96:0000:0000:426f:8e17:642a", |
|
"number": () => 0, |
|
"number_float": () => 0.0, |
|
"integer": () => 0, |
|
"boolean": (schema) => typeof schema.default === "boolean" ? schema.default : true |
|
} |
Q&A (please complete the following information)
OAS 3.1, Swagger UI 5.31.2
Content & configuration
Swagger/OpenAPI definition:
# your YAML hereSwagger-UI configuration options:
What FastAPI+Pydantic provides, but with vendored assets
Screenshots
How can we help?
I have
But I would like the rendered default to be
null- even if the type of the argument issuccess: bool(or, at least withsuccess: bool | None = None(PS: Python)IIUC, partially of the code responsible is here
swagger-ui/src/core/plugins/samples/fn.js
Lines 6 to 19 in cc40881