-
Notifications
You must be signed in to change notification settings - Fork 890
Description
How do I include a Resouce Ojbect Collection for the keys and values used for HTML 'options' tags of 'select' inputs?
For example, I have an HTML form to edit an 'Author', and wish to set the 'Country' select input by choosing from a list of 'Countries' found in my JSONAPI payload. Where would the Countries Resouce Object Collection be found within the document?
Do I use a different endpoint and make a second request? Is there a way I can instead include them in the 'included' member to eliminate the second request?
The ids for 'countries' resources would not appear in the primary data or related resources as 'full linkage'. Would this be allowable?
The JSONAPI specs state that any Resource Object Id under the 'included' member must also be referenced in the primary data, or related resources. All but 1 of my 'countries' Resource Objects found in the collection will have an ID reference at one given time, so it may go against the specification, and I'm not clear on how to proceed.
An example would be much appreciated.
Many thanks