Skip to content

Commit 3a0a950

Browse files
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 values
1 parent bcda594 commit 3a0a950

File tree

9 files changed

+765
-68
lines changed

9 files changed

+765
-68
lines changed

packages/openapi-generator/src/knownImports.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export const KNOWN_IMPORTS: KnownImports = {
297297
E.right({
298298
type: 'string',
299299
format: 'number',
300-
maximum: 0,
300+
minimum: 0,
301301
decodedType: 'bigint',
302302
}),
303303
NonPositiveBigInt: () =>

0 commit comments

Comments
 (0)