I am trying to limit the amount of fields returned by the GET request APIs, to ensure standardisation of the return JSONs given that there may be changes to the return values from the GET requests.
For example, for the cards GET request, I can limit the fields as such to name, desc, idList, idMembers, url and labels:
https://api.trello.com/1/cards/{id}?key=APIKey&token=APIToken&fields=name,desc,idList,idMembers,url,labels
I am able to successfully limit the fields.
However, I still want to limit the subfields, for example the labels field is an array of JSONs where each element in the labels field contain:
- labels.uses
- labels.color
- labels.idBoard
- labels.name
- labels.id
Recently I have noticed that a new subfield has been included which is labels.idOrganization and it is breaking my automations.
I want to avoid constantly changing my schema when extracting trello values (which I have done so in the past). How can I limit the labels field to only contain subfields that matter to me?
While it is possible to control what fields are returned on some sub-object (example: Members) Labels apprear to not be one of them.
That being said, for most development practices extra Json Fields added normally don't break existing code (example in C# Deserialization it is out of the box), so I would instead focus on you json parse method and make it recilient against new fields being added in general.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.