Skip to content

feat(openapi-generator): Improved OpenAPI schema generation #1030

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

youngjungithub
Copy link
Contributor

@youngjungithub youngjungithub commented Apr 3, 2025

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
  1. Special type handling:
  • Added proper format for UUID strings
  • Improved date/time formatting
  • Added JSON string format support
  • Better handling of numeric unions
  1. Parameter processing:
  • Removed redundant explode and style parameters
  • Added parent/paramName context for better schema inference
  • Improved handling of numeric constraints in unions
  1. 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

@youngjungithub youngjungithub requested a review from a team as a code owner April 3, 2025 21:00
@youngjungithub youngjungithub marked this pull request as draft April 3, 2025 21:00
@youngjungithub
Copy link
Contributor Author

Todo:

  1. Ensure all new functionality (lines of code may act as a proxy) is under test. This will prevent accidental regression in the future.
  2. Add any test cases necessary to ensure every custom mapping is under test.

@youngjungithub youngjungithub force-pushed the query-params branch 2 times, most recently from b0e349f to d3006e4 Compare April 6, 2025 15:17
…ic 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
@youngjungithub youngjungithub marked this pull request as ready for review April 6, 2025 15:27
@ericcrosson-bitgo ericcrosson-bitgo marked this pull request as draft May 12, 2025 16:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant