swagger-api / swagger-api/swagger-ui
Support for integers larger than i32
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: [e.g. macOS] Windows 11
- Browser: [e.g. chrome, safari] Brave
- Version: [e.g. 22] 5.17.14
- Method of installation: [e.g. npm, dist assets] dist assets
- Swagger-UI version: [e.g. 3.10.0] 5.17.14
- Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] 3.0
Describe the bug you're encountering
I am sending big numbers over my api and everything bigger than i32 gets wrongly displayed.
For example in my db the number is: 60503861139345408 but swagger-ui displays: 60503861139345410
To reproduce...
Steps to reproduce the behavior:
- serve large numbers over your api
- see what swagger-ui displays
Expected behavior
Display the correct number
Screenshots
//
Additional context or thoughts
I found this comment but I think this is right.
If I want to serve big numbers over my api swagger-ui should not be the limiting factor.
I understand that their is no correct way to serialize BigInts to Json but at the end the shown json file is just a string that is shown so I should be possible to serialize it to a string and remove the " right?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with Swagger UI 5.17.14 and an OpenAPI 3.0 API response containing 60503861139345408. Locate the response-display path responsible for numeric values and any existing coverage around it; done means the UI displays the exact integer without rounding, while preserving normal number rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100