Storyden
Nodes

Node Update Property Schema

Updates the property schema of this node and its siblings. All children of a node use the same schema for properties resulting in a table-like structure and behaviour. Property schemas are loosely structured and can automatically cast their values sometimes. A failed cast will not change data and instead just yield an empty value when reading however changing the schema back to the original type (or a type compatible with what the type was before changing) will retain the original data upon next read. This permits clients to undo changes to the schema easily while allowing quick schema changes without the need to remove or update values before.

PATCH/nodes/{node_slug}/property-schema

Updates the property schema of this node and its siblings. All children of a node use the same schema for properties resulting in a table-like structure and behaviour. Property schemas are loosely structured and can automatically cast their values sometimes. A failed cast will not change data and instead just yield an empty value when reading however changing the schema back to the original type (or a type compatible with what the type was before changing) will retain the original data upon next read. This permits clients to undo changes to the schema easily while allowing quick schema changes without the need to remove or update values before.

storyden-session<token>

In: cookie

Path Parameters

node_slug*string

Unique node Slug.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

[index: integer]?

Mutating property schemas permits updating existing fields as well as adding new fields. The discinction is determined by the presence of the id field. When an id field is provided, the operation is treated as an update operation where any of the other fields will be used to write new values. If an id field is omitted, the schema is considered a new field and is subject to a uniqueness constraint on the name field.

Response Body

application/json

application/json

curl -X PATCH "https://example.com/nodes/cc5lnd2s1s4652adtu50/property-schema" \  -H "Content-Type: application/json" \  -d '[    {      "name": "string",      "type": "text",      "sort": "string"    }  ]'
{
  "properties": [
    {
      "fid": "cc5lnd2s1s4652adtu50",
      "name": "string",
      "type": "text",
      "sort": "string"
    }
  ]
}
Empty
Empty
{
  "type": "string",
  "title": "string",
  "detail": "string",
  "trace_id": "string",
  "metadata": {}
}