Commit 3a0a950
committed
feat(openapi-generator): Improved OpenAPI schema generation for numeric and special types
This update enhances the OpenAPI specification generation with several improvements:
1. Numeric type handling:
- Changed `number` to `integer` type for integer schemas
- Added proper numeric constraints (minimum/maximum/multipleOf) for:
- Regular numbers
- BigInt values (now properly formatted as int64)
- String-encoded numbers
2. Special type handling:
- Added proper format for UUID strings
- Improved date/time formatting
- Added JSON string format support
- Better handling of numeric unions
3. Parameter processing:
- Removed redundant `explode` and `style` parameters
- Added parent/paramName context for better schema inference
- Improved handling of numeric constraints in unions
Fix minimum/maximum bug in openapi.ts and add tests for numeric constraints
- Fixed a bug in openapi.ts where minimum and maximum values were swapped
- Added comprehensive tests for numeric constraints in openapi.ts
- Ensured all custom mappings in openapi.ts are properly tested
- Fixed the handling of undefined minimum and maximum values1 parent bcda594 commit 3a0a950
File tree
9 files changed
+765
-68
lines changed- packages/openapi-generator
- src
- test
- openapi
9 files changed
+765
-68
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
0 commit comments