mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: Fix non-undefined values not rendering (#2036)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"fumadocs-openapi": patch
|
||||
---
|
||||
|
||||
OpenAPI: Fix non-undefined values not rendering
|
||||
@@ -126,7 +126,7 @@ export function Schema({
|
||||
value: string;
|
||||
}[] = [];
|
||||
|
||||
if (schema.default) {
|
||||
if (schema.default !== undefined) {
|
||||
fields.push({
|
||||
key: 'Default',
|
||||
value: JSON.stringify(schema.default),
|
||||
@@ -402,16 +402,16 @@ function getRange(
|
||||
exclusiveMax: number | undefined,
|
||||
) {
|
||||
const out = [];
|
||||
if (min) {
|
||||
if (min !== undefined) {
|
||||
out.push(`${min} <=`);
|
||||
} else if (exclusiveMin) {
|
||||
} else if (exclusiveMin !== undefined) {
|
||||
out.push(`${exclusiveMin} <`);
|
||||
}
|
||||
|
||||
out.push(value);
|
||||
if (max) {
|
||||
if (max !== undefined) {
|
||||
out.push(`<= ${max}`);
|
||||
} else if (exclusiveMax) {
|
||||
} else if (exclusiveMax !== undefined) {
|
||||
out.push(`< ${exclusiveMax}`);
|
||||
}
|
||||
if (out.length > 1) return out.join(' ');
|
||||
|
||||
Reference in New Issue
Block a user