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
Is your feature request related to a problem? Please describe.
Not all JSON:API servers implement resource routes using the type name as is. Most common deviation seem to be using pluralized routes and singular types, .e.g. "type": "author" vs /authors`.
For most part links are discovered through server responses, but if you want to create a new resource, or for your initial "get", there's no way at the moment to specify an alternate route.
Describe the solution you'd like
Instead I propose to add another property route to JsonApiResourceOptions which can be used to generate resource URLs where needed. If route is defined, use it for link generation, otherwise fall back to the type name as it does now.
Describe alternatives you've considered
While it might be tempting to add an optional strategy for automatic pluralization, I think it miss the point. JSON:API doesn't require routes to follow the type names, so it would only partially solve the problem.
Additional context
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Not all JSON:API servers implement resource routes using the type name as is. Most common deviation seem to be using pluralized routes and singular types, .e.g.
"type": "author" vs
/authors`.For most part links are discovered through server responses, but if you want to create a new resource, or for your initial "get", there's no way at the moment to specify an alternate route.
Describe the solution you'd like
Instead I propose to add another property
route
toJsonApiResourceOptions
which can be used to generate resource URLs where needed. Ifroute
is defined, use it for link generation, otherwise fall back to the type name as it does now.Describe alternatives you've considered
While it might be tempting to add an optional strategy for automatic pluralization, I think it miss the point. JSON:API doesn't require routes to follow the type names, so it would only partially solve the problem.
Additional context
The text was updated successfully, but these errors were encountered: