I am creating a POST endpoint where:
- Field A, B, and C are required and D is optional, but that may change - in the future, only A and B may be required, or D may be required
- Field E has an enumerated set of allowed values which may change (e.g. a set of supported ISO language codes)
Is there a JSON:API-friendly way to communicate this to clients, so that the front-end knows which fields are required for POST, and which values to display in the drop-down for E?
One possible solution is to have a non-JSON:API (or at least not idiomatic) endpoint the client can query to get these constraints in some defined format. Are there better solutions?