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
One way that it can be done is via changing convertToRouteTemplate function in EndpointRouting. Something like below should be enough:
| '%' :: c :: tail ->
let (placeholderName, placeholderTemplate), newTail =
match tail with
| ':' :: stail ->
let splitIndex = stail |> List.tryFindIndex (fun c -> c = '/')
match splitIndex with
| Some splitIndex ->
let name , newTail =
stail
|> List.splitAt splitIndex
getConstraint i c (Some (System.String.Concat(Array.ofList(name)))), newTail
| None ->
getConstraint i c (Some (System.String.Concat(Array.ofList(stail)))), []
| _ ->
getConstraint i c None, tail
let template, mappings = convert (i + 1) newTail
placeholderTemplate + template, (placeholderName, c) :: mappings
where getConstraint is changed like this
let private getConstraint (i : int) (c : char) (name : string option) =
let name = Option.defaultValue (sprintf "%c%i" c i) name
Do we want this feature?
On what scope it should work? (what names do we allow, do we want to have it in format %c:name. `name:%c' or different
The text was updated successfully, but these errors were encountered:
On what scope it should work? (what names do we allow, do we want to have it in format %c:name. `name:%c' or different?)
I think [type]:[name] would be alright. In Oxpecker, they also support the ASP.NET route constraints, thus the name is derived from the handler parameter type and the route looks like [type]:[constraint].
Not suggesting we change things drastically in Giraffe to conform to Oxpecker's way of doing things, just bringing it up for comparison.
Uh oh!
There was an error while loading. Please reload this page.
It seems that there is no way to name parameters in path (mainly for use in Swagger).

Something like {petId:%i} in https://github.com/hvester/EndpointBuilder will be very nice.
One way that it can be done is via changing
convertToRouteTemplate
function inEndpointRouting
. Something like below should be enough:where
getConstraint
is changed like this%c:name
. `name:%c' or differentThe text was updated successfully, but these errors were encountered: