This documentation section outlines the implementation and operational guidelines for a new API endpoint that facilitates partial updates to the system's schema.
As development teams regularly roll out new API endpoints, features each addition often necessitates corresponding updates to the schema. The current procedure, which requires comprehensive schema re-uploads for any modification, has proven to be inefficient and not conducive to rapid development cycles. There is an essential need for a more refined update mechanism that supports iterative and incremental schema modifications, allowing teams to make precise changes with minimal disruption.
Describe what the product or system should do, and how well it should perform.
/v1/{tenant_id}/schemas/partial-write
This endpoint allows authorized users to make partial updates to the schema by adding or modifying actions within individual entities.
Request Payload Structure
PATCH /v1/{tenant_id}/schemas/partial-write
Content-Type: application/json
{
"metadata": {
"schema_version": ""
},
"entities": {
"<entity-name>": {
"write": [],
"delete": [],
"update": []
}
}
}
When the schema_version
in the request metadata is left empty, the system will default to using the latest(head) schema version as the base for updates.
name
(string): The name of the entity to be changed.write
(string array): Conditions to be added. If a relation or permission/action already exists, it should return an error.delete
(string array): Names (permissions/actions) to be deleted. If the relation/permission/action name does not exist, it should return an error. Note: specifying the name is enough as relation/permission/action names should be unique.update
(string array): Conditions to be updated.