REST API
Schema Designer
JSON Schema is a specification for JSON-based format for defining the structure of JSON data
In PWR Apps users can create JSON schema using schema designer
If the user knows about JSON schema already he can create a schema by clicking generate schema button on the table
If the user does not know about JSON he can create JSON schema by clicking create new field button
Generate Schema:
Users can create JSON schema by passing JSON body
Users can recreate or merge JSON schema
Recreate:
it will create new fields
it will delete any existing fields which are not present in the request body
For example: If there are two files already present of type string and boolean and if we pass integer type field in the JSON then existing fields of type string and boolean will get deleted and number type field will get created
Request Body 1 { "StringType": "Hello", "booleanType": true } Request Body 2 { "numberType": 999, }
it will overwrite any existing fields
For example: If there is one filed present of type integer with property name value and later we pass "value": "infinite" then it will overwrite value property by changing its type to string
Request Body 1 { "value": 789 } Request Body 2 { "value": "infinite", }
Merge:
it will create new fields
it will not delete any existing fields
it will overwrite any existing fields i.e it will update any existing field
For example: If two fields are already present and we pass the number type field in the JSON and update the boolean filed property value then it will retain existing fields i.e of type string and it will create a new field of type number and update existing i.e of type boolean
Request Body 1 { "StringType": "Hello", "booleanType": true } Request Body 2 { "numberType": 999, "booleanType": false }