Open theNerd247 opened 6 years ago
I'm a bit rusty on this, but I think you will need to define how to parse the segment (which is a String) into your Foo
. In that sense the cardinality doesn't matter, in any case you need to provide a function String -> Foo
(or similarly using Read
). It's left up to you to decide when the first field ends and the second begins.
So can would I be able to parse foo/10/blarg
assuming the parser will take 10/blarg
as the input?
I don't think that's actually possible. What does that URL mean? Usually you'd have foo
be a type of object in your API, and the next identifier would be an id to a specific foo. Where does the string come in?
If these are subproperties of some object, you can use selects
in the resource for subselections on your resource, which would give you the url you want.
If these are two parts of the same identifier, the easiest thing here is to use a URL like foo/10-blarg
and write a Read
instance to parse that into a Foo
.
Is it possible to use an identifier such that: