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

[Bug]: There is no way to set the description for OpenAPI responses openapi-emitter [emitter:openapi3] #4242

Closed
4 tasks done
AngelEVargas opened this issue Aug 22, 2024 · 4 comments
Labels
bug Something isn't working needs-area

Comments

@AngelEVargas
Copy link

AngelEVargas commented Aug 22, 2024

Describe the bug

Documentation strings added to the TypeSpec model or attributes of the response are not reflected in the generated OpenAPI responses description. Instead, the descriptions added by the emitter are some standard ones.

@doc("How to replace standard description with this one?")
model NotAuthenticatedError extends Errors.Error {
  @doc("Or maybe with this other?")
  @statusCode
  _: 401
}

Generates:

       '401':
          description: Access is unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotAuthenticatedError'

cc @mario-guerra

Reproduction

Playground

Checklist

@AngelEVargas AngelEVargas added the bug Something isn't working label Aug 22, 2024
@AngelEVargas AngelEVargas changed the title [Bug]: There is no way to set the description for OpenAPI responses [Bug]: There is no way to set the description for OpenAPI responses openapi-emitter [emitter:openapi3] Aug 22, 2024
@mario-guerra
Copy link
Member

@timotheeguerin is it possible to override the default operation description?

@chrisradek
Copy link
Member

I believe this is a duplicate of #3664 which is also marked as a bug.

Currently you'd need either an empty model, or explicitly define the body/bodyRoot parameter like this: playground

@AngelEVargas
Copy link
Author

Thank you @chrisradek that is helpful

@mario-guerra
Copy link
Member

@AngelEVargas closing this issue as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-area
Projects
None yet
Development

No branches or pull requests

3 participants