Task 5 - Create and-fetch a Schema
Task 5 - Create a Schema
This task explains how to create a schema for your application.
A schema is an object in the Forge Schema service that represents a schema specification. A schema specification is a blueprint that describes how information is organized and constrained within a block of data. It is essentially a JSON specification that defines the constituents of the data. It provides a structure and set of rules to keep everything consistent and interoperable in a system.
Expected task outcome
By the end of this task you will be able to:
- Create a draft schema.
- Fetch a draft schema.
- Publish schema.
- Fetch Published schema
Endpoints used in this task
You will use the following API endpoints in this task:
.. list-table:: :widths: 10, 50, 40 :header-rows: 1
-
- Method
- Endpoint
- Operation
-
- POST
- /groups/{groupId}/libraries/{libraryId}/schemas:draft-create
Create a Draft Schema_
-
- POST
- /groups/{groupId}/libraries/{libraryId}/schemas
Publish New Schema_
-
- GET
- /schemas/propertySets:{groupId}.{libraryId}:{schemaId}-{version}
Fetch a Version of a Schema_
Step 1 - Create a Draft Schema
In postman, Select Task 5 > POST Create a Draft Schema and click Send. The equivalent cURL request is as follows.
Note the status attribute is draft.
Request
|
Response
Step 2 - Fetch Draft Schema
In postman, Select Task 5 > GET Fetch Draft Schema request and click send. The equivalent cURL request is as follows.
Request
|
Response
Note the status attribute is draft.
Step 3 - Publish Schema
In postman, Select Task 5 > POST Publish Schema and click Send. The equivalent cURL request is as follows.
Note the status attribute is Published.
Request
|
Response
Step 4 - Fetch Published Schema
In postman, Select Task 5 > GET Fetch Published Schema and click Send. The equivalent cURL request is as follows.
Request
|
Response
Note the status attribute is published.