-
Notifications
You must be signed in to change notification settings - Fork 334
Extract the response interpretation logic out of openapi3 emitter and into http library #355
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
Merged
timotheeguerin
merged 12 commits into
microsoft:main
from
timotheeguerin:http-common-responses
Mar 25, 2022
Merged
Extract the response interpretation logic out of openapi3 emitter and into http library #355
timotheeguerin
merged 12 commits into
microsoft:main
from
timotheeguerin:http-common-responses
Mar 25, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… into http library
nguerrera
reviewed
Mar 22, 2022
nguerrera
approved these changes
Mar 22, 2022
bterlson
reviewed
Mar 22, 2022
markcowl
requested changes
Mar 23, 2022
markcowl
approved these changes
Mar 24, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
*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@defaultResponsedecorator will also set the statusCode to*This means that in the openapi emitter we convert
*todefaultop read(): string | nullcorrectly before. This ignore the problem slightly differently. Created an issue to investigate more Nullable response have a weird behavior right now #356