Retrieve an entity schema
The entity-schemas
endpoints return a complete product schema, or can be
filtered to target specific sets of entities. The information returned is similar to
what you would find in the swagger and openapi endpoints, but with additional metadata.
(See Viewing API definitions for information on the swagger and openapi endpoints.)
Use the following command to retrieve a JSON-formatted entity schema:
GET /common/v1/entity-schemas
To retrieve the schema for a single entity, use the following command:
GET /common/v1/entity-schemas/{entityId}
For example, you can return the schema for the User entity with the following command:
GET /common/v1/entity-schemas/User
The schema returned by the entity-schemas/{entityId}
endpoint returns
the schema for the specified entity and other schemas transitively referenced from that
entity. In the preceding example, in the base configuration the returned entity schema
would include User, plus related schemas such as UserGroupReference and
UserRoleReference. However, it won’t return the schemas for any child entities. Instead
it will return a list of children (if any) in the x-gw-children
property for each entity. (See “Child entities” in Schema properties usage for more information.)
To retrieve a specific entity along with the complete schema information for
all its children, filter the entity-schemas
endpoint on
rootEntity
:
GET
/common/v1/entity-schemas?filter=rootEntity:eq:{entityId}
Filtering on rootEntity
retrieves a more detailed schema than
using the entity-schemas/{entityId}
endpoint by traversing the entity
graph tree and including all the child entities of the specified entity.