Skip to content

Conversation

@timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin commented Mar 22, 2022

The openapi3 and autorest library were doing a lot of the interpreting of how the cadl represent the http layer. This should really be let to the http library. We already have similar logic for the input parameters which are resolved in the http layer.
This should reduce the duplicated code between autorest and openapi3 emitters.

Some small changes were required to have rest stay unaware of openapi concept.

  • Allow * as a statusCode behind the scene user cannot set it. if response has @error it will have status set to * unless one is provided. The @defaultResponse decorator will also set the statusCode to *
    This means that in the openapi emitter we convert * to default
  • We we weren't handling op read(): string | null correctly before. This ignore the problem slightly differently. Created an issue to investigate more Nullable response have a weird behavior right now  #356

@timotheeguerin timotheeguerin enabled auto-merge (squash) March 25, 2022 00:28
@timotheeguerin timotheeguerin merged commit dbe2f85 into microsoft:main Mar 25, 2022
@timotheeguerin timotheeguerin deleted the http-common-responses branch August 15, 2022 17:38
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

Successfully merging this pull request may close these issues.

4 participants