Skip to content

Commit

Permalink
Support Integers in Response sample (#2592)
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhanshub authored Nov 28, 2024
1 parent fc8065b commit 867481c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nervous-sheep-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': patch
---

Support Integers in Response example
2 changes: 1 addition & 1 deletion packages/react-openapi/src/generateSchemaExample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function generateSchemaExample(
return 'text';
}

if (schema.type === 'number') {
if (schema.type === 'number' || schema.type === 'integer') {
return schema.default || 0;
}

Expand Down

0 comments on commit 867481c

Please sign in to comment.