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

adding string to end of union used for content-type header results in error #2853

Open
swathipil opened this issue Jan 29, 2024 · 10 comments
Open
Labels
design:needed A design request has been raised that needs a proposal lib:http triaged:core
Milestone

Comments

@swathipil
Copy link
Member

swathipil commented Jan 29, 2024

Link to repro in playground [here].

In SchemaRegistry, we want to the content type header to be a union of values. This does not compile when string is added to the end of the union, and fails with:

contentType parameter must be a string literal or union of string literals

It works when string; on line 66 of the playground link above is removed. However, it should work when string is added to the end. It also works when the header is renamed to something else, so it seems to be a bug with using the "Content-Type" header specifically.

May be related to #2727

@markcowl
Copy link
Contributor

markcowl commented Feb 5, 2024

  • relax this requirement in http (allow open string, but not non-string types)
  • open content-types should use a bytes type payload (linter -> warning diagnostic)
  • allow string
  • should we allow wildcard types explicitly as literals without an open string variant (e.g. application/*, /)
  • Add linter rule to Azure.Core to encourage explicit enumeration of allowed content-types

In responses:

  • wildcard types imply an 'accepts' header.

@markcowl markcowl added design:needed A design request has been raised that needs a proposal DPG Impact labels Feb 5, 2024
@markcowl
Copy link
Contributor

markcowl commented Feb 5, 2024

  • discuss with dpg team, need to design support (if any) in TCGC

@markcowl markcowl added this to the [2024] March milestone Feb 5, 2024
@markcowl markcowl self-assigned this Feb 12, 2024
@markcowl
Copy link
Contributor

@markcowl discuss with DPG and then file impl issues

@catalinaperalta
Copy link
Member

@markcowl do we have an impl issue for this? And do you know what sprint it is planned for?

@swathipil
Copy link
Member Author

Hi @markcowl - Any updates on when this will be addressed? We have a service where this issue will block the release of this service: Azure/azure-rest-api-specs#25168 (comment)

@markcowl markcowl modified the milestones: [2024] March, [2024] April Mar 11, 2024
@markcowl
Copy link
Contributor

@swathipil This service spec has been merged.

@swathipil
Copy link
Member Author

swathipil commented Mar 11, 2024

thanks @markcowl! We merged the spec, but added a TODO comment in the spec to address the issue as soon as the fix for this is in. We're still blocked from releasing any SDKs generated by this spec until this issue is addressed.

@swathipil
Copy link
Member Author

Hi @markcowl - We're blocked from releasing our SDKs by this issue (as per comment above), and we plan on releasing this upcoming release week. Do you know when this will be addressed?

@timotheeguerin
Copy link
Member

@timotheeguerin timotheeguerin removed this from the Backlog milestone Jul 2, 2024
@swathipil
Copy link
Member Author

swathipil commented Jul 8, 2024

We were able to test out the scenario that we believed would have been blocking, and it passed. Can confirm that this is non-blocking. Thanks @timotheeguerin!

@markcowl markcowl added this to the [2024] October milestone Jul 15, 2024
@markcowl markcowl removed this from the [2024] October milestone Oct 1, 2024
@markcowl markcowl added this to the [2024] November milestone Oct 1, 2024
@markcowl markcowl modified the milestones: [2024] November, Backlog Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal lib:http triaged:core
Projects
None yet
Development

No branches or pull requests

5 participants