Skip to content

Commit 7cbc97a

Browse files
committed
update docs
1 parent c8a8ae2 commit 7cbc97a

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

docs/json-schema/schema-types/object.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,29 @@ $productSchema = Schema::object('product')
103103
```
104104
</Accordion>
105105

106+
## Property Titles
107+
108+
Property names are defined by the schema constructor argument, while `title()` is metadata and only included when it differs from the property name:
109+
110+
```php
111+
$schema = Schema::object()
112+
->properties(
113+
Schema::string('email')->title('Email Address')
114+
);
115+
```
116+
117+
```json
118+
{
119+
"type": "object",
120+
"properties": {
121+
"email": {
122+
"type": "string",
123+
"title": "Email Address"
124+
}
125+
}
126+
}
127+
```
128+
106129
## Required Properties
107130

108131
Specify which properties are mandatory:

0 commit comments

Comments
 (0)