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

Move content type default resolution to rest library #1311

Closed
timotheeguerin opened this issue Nov 24, 2022 · 1 comment · Fixed by #3342
Closed

Move content type default resolution to rest library #1311

timotheeguerin opened this issue Nov 24, 2022 · 1 comment · Fixed by #3342
Milestone

Comments

@timotheeguerin
Copy link
Member

Right now if no content type is provided this is left to the openapi and autorest emitter to interpret. We should move the logic upstream in rest library.

@ghost ghost added the Needs Triage label Nov 24, 2022
@markcowl markcowl added this to the [2023] January milestone Nov 28, 2022
@markcowl
Copy link
Contributor

est: 3
pri: 1

@markcowl markcowl modified the milestones: [2023] March, [2023] April Jan 28, 2023
@markcowl markcowl modified the milestones: [2023] April, Backlog Mar 14, 2023
github-merge-queue bot pushed a commit that referenced this issue Jun 3, 2024
resolve #3046
[Playground](https://cadlplayground.z22.web.core.windows.net/prs/3342/)

Add the following:
- `@multipartBody` decorator
- `File` type
- `HttpPart<Type, Options>` type


Had to do a decent amount of refactoring to be able to reuse the body
parsing, this result in a much cleaner resolution of the body and other
metadata properties across request, response and metadata.

The way it works now is instead of calling `gatherMetadata` that would
just get the properties that are metadata but also ones with `@body` and
`@bodyRoot` we now call a `resolveHtpProperties`, this does the same
resolution in term of filtering properties but it also figure out what
is the kind of property in the concept of http(header, query, body,
etc.) this leaves the error resolution to this function for duplicate
annotations.
What is nice is now we don't need to keep asking oh is this a query or a
header or a body we can just check the kind of `HttpProperty`

also resolve #1311
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 a pull request may close this issue.

3 participants