Skip to content

Commit 51aa5cf

Browse files
authored
fix: improve identity schema example (#2422)
* fix: improve identity schema example * chore: grammar * fix: add clarification
1 parent a5c6a8f commit 51aa5cf

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

docs/kratos/manage-identities/15_customize-identity-schema.mdx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,14 +1312,11 @@ You may also mix usernames and passwords:
13121312

13131313
### Advanced schema
13141314

1315-
The following identity schema includes first name, last name, a nickname, and numerical fields for the users' age. There are also
1316-
two checkboxes for specifying the newsletter subscription and enterprise customer status.
1317-
1318-
:::note
1319-
1320-
This identity schema is just an example. It contains too many fields to be used in production.
1321-
1322-
:::
1315+
The following identity schema defines personal fields for first name, last name, nickname, and age, and includes two checkboxes:
1316+
one required for accepting the terms of service and one optional for newsletter subscription.
1317+
To render links in a checkbox label, use markdown link syntax. Links open in a new tab.
1318+
To make a checkbox required, add `"const": true` to the property definition. This differs from text fields, which use the required
1319+
array.
13231320

13241321
````mdx-code-block
13251322
<Tabs>
@@ -1386,14 +1383,15 @@ This identity schema is just an example. It contains too many fields to be used
13861383
"type": "integer",
13871384
"title": "How old are you?"
13881385
},
1389-
"newsletter": {
1386+
"tos": {
13901387
"type": "boolean",
1391-
"title": "Newsletter subscription"
1388+
"title": "I accept the [terms of service](https://example.com/tos)",
1389+
"const": true
13921390
},
1393-
"enterprise": {
1391+
"newsletter": {
13941392
"type": "boolean",
1395-
"title": "Are you an Enterprise customer?"
1396-
}
1393+
"title": "I want to sign up for the newsletter"
1394+
},
13971395
},
13981396
"required": [
13991397
"email"

0 commit comments

Comments
 (0)