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

Consider making @route optional #307

Open
bterlson opened this issue Mar 9, 2022 · 4 comments
Open

Consider making @route optional #307

bterlson opened this issue Mar 9, 2022 · 4 comments
Assignees
Labels
design:needed A design request has been raised that needs a proposal
Milestone

Comments

@bterlson
Copy link
Member

bterlson commented Mar 9, 2022

It seems like we could infer a route fragment from the name of the operation. This would make adding a RPC-ish endpoint into an interface much easier.

@timotheeguerin
Copy link
Member

I think this is a slightly similar to inferring the verb from the operation name which we decided was a bad idea. At least for now.

@route("/foo")
interface Foo {
   // Does this goes to `/foo` or `/foo/read`. If 1. then when do we decide to use the operation name vs not.
  @get op read(): string;
}

@bterlson
Copy link
Member Author

bterlson commented Mar 9, 2022

I would propose /foo/read (everything behaves as if the routeless operation had an @route of the operation name). This rule seems much simpler/less surprising than inferring verbs.

@timotheeguerin
Copy link
Member

This however makes this scenario much more verbose

@route("foo/:foo")
interface ResourceEndpoint {
   @route("")
   @get
   op getResource(): T

   @route("")
   @put
   op createOrUpdate(): T

   @route("")
   @put
   op patch(): T

   @route("")
   @put
   op delete(): T
}

@bterlson
Copy link
Member Author

Yeah... that is a good point.

@markcowl markcowl added this to the Backlog milestone Mar 17, 2022
@markcowl markcowl added the design:needed A design request has been raised that needs a proposal label May 6, 2022
@markcowl markcowl modified the milestones: Backlog, [2022] July May 11, 2022
@markcowl markcowl assigned daviwil and bterlson and unassigned daviwil May 12, 2022
@markcowl markcowl modified the milestones: [2022] July, [2022] August Jul 7, 2022
@markcowl markcowl modified the milestones: [2022] December, Backlog Dec 13, 2022
@bterlson bterlson removed the 📌 label May 10, 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
Projects
None yet
Development

No branches or pull requests

5 participants