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

OAS3 emitter should have the capability to generate the specification into multiple files #5464

Open
3 tasks done
lirenhe opened this issue Dec 30, 2024 · 0 comments
Open
3 tasks done
Labels
emitter:openapi3 Issues for @typespec/openapi3 emitter

Comments

@lirenhe
Copy link
Member

lirenhe commented Dec 30, 2024

Clear and concise description of the problem

For smaller APIs, it is better to keep everything in a single file for simplicity.
However, as the API grows, it becomes more practical to put the specification into multiple files. This would helps in managing and maintaining the spec more efficiently.

Today, OAS3 emitter only provides limited functions for the output file and it does not support generate the specification into multiple files. https://typespec.io/docs/emitters/openapi3/reference/emitter/

Proposal:
To have one more emitter config to control the generation. so that we could have

  • models: Put all model definitions in a separate file.
  • Paths: Defining each endpoint's operations in separate files .
  • Parameters and Responses: Storing reusable parameters and responses in their own files.

We could also consider leverage namespace defined in tsp to further split the huge file.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@lirenhe lirenhe added the emitter:openapi3 Issues for @typespec/openapi3 emitter label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:openapi3 Issues for @typespec/openapi3 emitter
Projects
None yet
Development

No branches or pull requests

1 participant