-
-
Notifications
You must be signed in to change notification settings - Fork 158
Hard-coded convention #787
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
Comments
Hi @mkoppanen, thanks for reporting this. I recently found this one too. The fix is easy, I'll add it to the changes I'm currently working on and link to here once I have a PR. Any other places where you've seen that casing conventions are not respected? |
Haven't seen other ones. I think another similar thing I ran into was using "id" as hardcoded route parameter for patch requests. I sometimes see cases where API has "one of" something /api/users/{userId}/profile and thus natural patch endpoint would be PATCH /api/users/{userId}/profile. If one has other things tied into {userId} being the route it would be nice to have attribute to override "BaseId" per controller or per endpoint. |
I'm afraid I don't understand what you mean by that. If this "id' thing is unrelated to casing convention, can you please open a new issue for it and provide an example to clarify the problem? |
Sure thing and it was unrelated to the original. Thanks for quick replies! |
Description
The API has hardcoded convention at places and it would be nice to change this by simply providing a ConventionProvider or similar. An example is:
https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/src/JsonApiDotNetCore/Serialization/Server/Builders/MetaBuilder.cs#L46
Where "total-records" is hardcoded. One could provide different implementation of IMetaBuilder but it seems like an overkill when doing such simple changes.
...
Environment
The text was updated successfully, but these errors were encountered: