Skip to content

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

Open
@lirenhe

Description

@lirenhe

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.

Metadata

Metadata

Assignees

Labels

emitter:openapi3Issues for @typespec/openapi3 emitter

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions