# Contextual Schema Extensions

Contextual Object Type schemas start with standard JSON Schema, but they also support a small set of platform-specific extensions that drive record identity, UI behavior, generated values, and relation-aware features.

These extension fields are understood by Contextual tooling and are removed or interpreted before the underlying JSON Schema validation runs.

## Common top-level extensions

* `primaryKey` - identifies the permanent record key for the Object Type
* `relations` - describes record relationships used by related-record and relation-aware UI features

## Common property-level extensions

* `secret: true` - stores the property value as an encrypted secret instead of a plain record value
* `generate` - automatically populates the property when a record is created
* `renderer` - selects a specialized UI renderer for the property in Contextual's admin experience

## Renderer examples

The admin console supports renderer-driven experiences beyond what vanilla JSON Schema provides. Examples visible in the current product code include:

* `code-editor`
* `relation`
* `flow-relation`

These values are used by Contextual UI renderers and should be treated as platform features rather than generic JSON Schema keywords.

## Related pages

* [ID and PrimaryKey Permanence](/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/id-and-primarykey-permanence.md)
* [Automatic Record Metadata](/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/automatic-metadata.md)
* [Secrets](/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/secret.md)
* [Generated Values](/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/generated-properties.md)
* [UI Schemas](/documentation-and-resources/components-and-data/object-types/object-type-details/ui-schemas.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.contextual.io/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/contextual-schema-extensions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
