-
Notifications
You must be signed in to change notification settings - Fork 55
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
[Proposal] EndPoint: Specify full path with placeholders #10
Labels
Comments
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 17, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 17, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 18, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
…ames ie allows this: type Foo = | [<EndPoint "/{x}/a">] A of x: string | [<EndPoint "/{y}/b">] B of y: string
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
…ames ie allows this: type Foo = | [<EndPoint "/{x}/a">] A of x: string | [<EndPoint "/{y}/b">] B of y: string
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 19, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 21, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 22, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 22, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 22, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 22, 2019
Tarmil
added a commit
to Tarmil/Bolero
that referenced
this issue
Jan 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proposal: make the EndPoint syntax more complete by specifying the full path with
{field}
placeholders.Example:
If an EndPoint is just one non-placeholder fragment, it works like currently: fields are added one after another.
It is an error for an EndPoint to specify some but not all of the fields.
This should support multiple endpoints with a common prefix. For example:
In the above:
/article/by-id
is matched withById
/article/by-slug
is matched withBySlug
/article
is matched withArticle
.In particular, the path
/article/by-id
is not matched againstArticle
, even though it would succeed. The parser looks for constant fragments, and if none corresponds, it looks for field fragments; but once it has chosen one of these branches, it does not backtrack.Question: is the above a good design? Or should paths that correspond to a constant fragment but fail to match the rest of the pattern be tried against field fragments?
A common prefix should also be able to include a field. For example:
The field name is of course irrelevant and doesn't have to be the same.
Question: what should happen if two endpoints have a common prefix up to a field with different types? eg:
Possible extensions:
{*field}
to catch the rest of the path, of typestring
,list<_>
orarray<_>
. It must be unique and at the end of the path.{?field}
for optional fields, of typeoption<_>
. They must all be at the end of the path, before{*field}
if any.Some form of handling for query parameters. Possible syntax:
The text was updated successfully, but these errors were encountered: