-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make fields mandatory ? #283
Comments
one way to fix this, is to change the default api/xxx to only exposing id,name,url. |
It's logging related : if you want to see effectively all the used fields, you have to iterate de logs
If we do this, we loose the easy and sexy way of using our API : just write the resource route, then navigate with uri |
In my case, that was a query on the collection. And here I assume that we won't restrict collection calls to only id,name,url in returned JSON.
Not sure to understand ? Logs does not contains response bodies, and you don't know what the caller will do with the returned JSON.
One point ;) We could make fields mandatory IF you want to get other fields than id,name,url. And if you do not precise fields, you only get id,name,url, no matter it's a collection or entity call. Good for you ? |
You have to assume that the caller knows what he's doing of course, and will consume exactmy what he asked. Before changing anything and agreeing on a solution, i'd like to assess if that's a real problem thus. I agree with @rducom that logging seems to be the natural way to handle this |
When you want to change your API surface (new field, rename field, change field type), it would be great if you could see who is effectively using your API, and which fields they are using.
This way, your can decide whether you can safely change the field (breaking change) or if you have to take uses of your field in account and be backward compatible for a while.
One way of ensuring this is to make the fields query parameter mandatory.
Users of your API should now explicitely tell which fields of your resources they are relying on.
Related to #53, #214
The text was updated successfully, but these errors were encountered: