Skip to content

To validate CRUD of table information with a single Json-Schema, we propose an attribute for PrimaryKey. #1495

Open
@Yuutakasan

Description

@Yuutakasan

I am currently defining an API in OpenAPI Spec, and it is great that Json-Schema can validate data structures, but I am having trouble separating Json-Schema from Json-Schema for INSERT, SELECT, UPDATE, and DELETE, because the handling of required items changes. However, I am having trouble separating Json-Schema for INSERT, SELECT, UPDATE, and DELETE because the handling of required fields changes.

I propose that the PrimaryKey attribute be set so that the same Json-schema can be used to validate each CRUD operation and the corresponding HTTP Method request.

We would like the PrimaryKey attribute to be ignored for INSERT and evaluated as required for UPDATE, PATHCH, and DELETE operations when the validator is told which CRUD operation is being processed.

It is painful that in the case of Entity definitions in ORM, one definition can manage all CRUDs, but Json-Schema does not.

Again, if anyone knows of a good solution, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalInitial discussion of a new idea. A project will be created once a proposal document is created.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions