Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Interceptor type schema auto-generation from OpenAPI/Swagger #66

Open
10 of 19 tasks
diego-aquino opened this issue Feb 12, 2024 · 1 comment
Open
10 of 19 tasks
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@diego-aquino
Copy link
Member

diego-aquino commented Feb 12, 2024

Following the discussions on #21, Zimic will support inferring and generating interceptor type schema from OpenAPI/Swagger specifications. Learn more at the section "Alternative 3" of the summary comment.

  • Rename components[] everywhere
  • Find a way to normalize response declarations using schemas
  • Consider components['responses] as response declarations
  • Normalize boolean search params and headers to ${boolean}
    • If referenced from parameters or headers, use ${boolean}
    • Keep the original schema if referenced from 'schemas', but use ReplaceBy<Type, boolean, ${boolean}>
  • Normalize numeric search params and headers to ${number}
    • If referenced from parameters or headers, use ${number}
    • Keep the original schema if referenced from 'schemas', but use ReplaceBy<Type, number, ${number}>
  • Normalize components['responses'] as response declarations
  • Normalize components['requestBodies'] as request body declarations
  • Normalize components['pathItems'] as path declarations
  • Change unknown types to any at the end
  • Remove header types containing only any or unknown
  • Consider blobs
  • Consider form data
  • Consider url search params as body
  • Consider security schemes
  • Export enum type values (enumValues: true)

https://openapi-ts.pages.dev/node

@diego-aquino diego-aquino added the enhancement New feature or request label Feb 12, 2024
@diego-aquino diego-aquino added this to the v1.1.0 milestone Feb 12, 2024
@diego-aquino diego-aquino modified the milestones: v1.1.0, v0.5.0, v0.6.0, v0.8.0 Feb 20, 2024
@diego-aquino diego-aquino modified the milestones: v0.8.0, v0.7.0 Mar 29, 2024
@diego-aquino diego-aquino modified the milestones: v0.7.0, v0.6.0 Apr 7, 2024
@diego-aquino diego-aquino modified the milestones: v0.6.0, v0.7.0 Apr 15, 2024
@diego-aquino diego-aquino self-assigned this May 4, 2024
@diego-aquino diego-aquino modified the milestones: v0.7.0, v0.8.0 Jun 8, 2024
@diego-aquino
Copy link
Member Author

zimic typegen openapi ./my-service.yaml -o my service.d.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant