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

Support ability to include Tags in the OpenAPI spec generation #1378

Open
denniswieczorek opened this issue Apr 2, 2024 · 1 comment
Open

Comments

@denniswieczorek
Copy link

Problem

As far as I can tell, it is not currently possible to create operations in a way so that they can be grouped in the generated OpenAPI spec.

Suggested solution

Use Tags

OpenAPI's Operation Object supports the concept of tags to organize operations.

From the docs:

A list of tags for API documentation control. 
Tags can be used for logical grouping of operations by resources or any other qualifier.

Implementation

An optional tags parameter on createOperation.query, createOperation.mutation, createOperation.subscribe that is consumed in the OpenApiBuilder to add tags to the generated spec.

e.g.

// foo/bar.ts
export default createOperation.query({
  input,
  tags: ['Foo'],
  handler: () => {...},
})

Would produce something like

...
"paths": {
    "/foo/bar": {
      "get": {
        "tags": ["Foo"],
        "operationId": "...",
        "parameters": [...],
        "responses": {...},
      },
    },
...

Alternatives

None that I can think of.

Additional context

@acdn-tsmith
Copy link

PR: #1382

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

No branches or pull requests

2 participants