You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be doing something wrong, but I was sort of expecting to be able to have the last url path parameter be optional.
Example:
If you have the rest endpoint /customers, it will return information on all customers.
And if you have the rest endpoint /customers/123, it will return information on customer id 123
But the downside is that the above produces two swagger endpoint definitions, and also allows things like this, which should not be allowed: /customers?id=123
So, is there a way to do this, without creating a second rpc definition with a new name and new request parameter?
The text was updated successfully, but these errors were encountered:
This is not something I'm sure we should support. What you're describing sounds to me like two different RPCs, CustomersGet and CustomersList (using your terminology). Why not have two endpoints? Presumably the response types will be different?
I might be doing something wrong, but I was sort of expecting to be able to have the last url path parameter be optional.
Example:
If you have the rest endpoint
/customers
, it will return information on all customers.And if you have the rest endpoint
/customers/123
, it will return information on customer id123
Any attempt to curl just
/customers
returns a 404, with that endpoint not existing.In the end, this worked:
But the downside is that the above produces two swagger endpoint definitions, and also allows things like this, which should not be allowed:
/customers?id=123
So, is there a way to do this, without creating a second rpc definition with a new name and new request parameter?
The text was updated successfully, but these errors were encountered: