ADR: New API to handle system schemas
- Under review
Public schemas are schemas which are available to all the tenants out of the box. Today the public schema includes schema from OSDU or SLB and are located in Schema service repository here: https://community.opengroup.org/osdu/platform/system/schema-service/-/tree/master/deployments/shared-schemas
How it's done today:
- Deployment expects existence of a special partition (generally termed as
common) which will be used to load public schemas
- Schema service has only one endpoint today
/schema. Based on the
data-partition-idpassed in the request headers, it's decided whether the schema is public or private.
- If the data-partition-id passed is "special partition", then the created schema is public, otherwise it's private. This is indicated by a field named
SCOPEin crated schema.
Issue with current design:
- The API behavior of
/schemaendpoint changes based on the data-partition-id header and can be confusing to users. Users might end up unknowingly creating public schemas by passing data-partition-id of special partition.
- The special partition is expected to be provisioned for provisioning public schemas.
There are two types of schemas in the system, public (or system) schemas and private schema. The proposal is to create a dedicated API to created/ update system schemas. Hence-
- The new API shall be termed as
To create/ updated public schema-
/schemas/systemendpoint shall be used
To read public schema- existing
GET /schemaendpoint shall be used (same as current behaviour)
- The new API shall not accept
data-partition-idas a header. Service would be aware where the public schemas are located.
- The authorization of new end point shall be different from exiting schema.editor/viewer role.
Sequence diagram for reading public schema