Skip to content

How to communicate requirements/constraints for POST? #1486

@cmeeren

Description

@cmeeren

I tried asking on the forum, but there were no replies. Asking here with slight modifications:

I am creating a POST endpoint where:

  • Field A may or may not be required depending on the currently authenticated user
  • Field B and C are required and D is optional, but that may change - in the future, only B may be required and not C, or D may be required
  • Field E has an enumerated set of allowed values which may change

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    extensionRelated to existing and proposed extensions as well as extensions in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy