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

[OpenAPI 3] Spurious error on op with same path and different verb from a shared route #2925

Closed
bterlson opened this issue Feb 16, 2024 · 1 comment · Fixed by #2948
Closed
Assignees
Labels
bug Something isn't working triaged:core
Milestone

Comments

@bterlson
Copy link
Member

Playground

import "@typespec/http";

using TypeSpec.Http;
@service({
  title: "Widget Service",
  version: "1.0.0",
})
namespace DemoService;

@sharedRoute
@post
op createUrlAttachment(
  @header contentType: "application/json",
  @path itemId: string,
  contents: { x: string },
): OkResponse | NotFoundResponse;

@sharedRoute
@post
op createFileAttachment(
  @header contentType: "multipart/form-data",
  @path itemId: string,
  contents: bytes,
): OkResponse | NotFoundResponse;

@delete op delete(@path itemId: string): OkResponse | NotFoundResponse;

The delete op gets the error "All shared routes must agree on the value of the shared parameter." but I believe they do agree.

@markcowl markcowl added the bug Something isn't working label Feb 20, 2024
@markcowl
Copy link
Contributor

  • fix the bug

@markcowl markcowl added this to the [2024] March milestone Feb 20, 2024
@timotheeguerin timotheeguerin self-assigned this Feb 23, 2024
timotheeguerin added a commit that referenced this issue Feb 28, 2024
fix [#2925](#2925)

Stop emitting the error if there is a shared route and a non shared
route on a different verb.

Also improve the error: 
- change message to be a little more clear
- emit the error on every offending operation not just the first one we
find an duplicate

---------

Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
markcowl pushed a commit to markcowl/cadl that referenced this issue Mar 8, 2024
fix [microsoft#2925](microsoft#2925)

Stop emitting the error if there is a shared route and a non shared
route on a different verb.

Also improve the error: 
- change message to be a little more clear
- emit the error on every offending operation not just the first one we
find an duplicate

---------

Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged:core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants