Skip to content

Commit 212d7c3

Browse files
committed
update docs
1 parent f96349f commit 212d7c3

3 files changed

Lines changed: 20 additions & 16 deletions

File tree

docs/tutorials/command_line_client.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,13 @@ Register a JSON Schema to a Synapse organization for later binding to entities.
569569
synapse register-json-schema [-h] [--schema-version VERSION] schema_path organization_name schema_name
570570
```
571571
572-
| Name | Type | Description | Default |
573-
|-----------------------|------------|-------------------------------------------------------------------------------------|---------|
574-
| `schema_path` | Positional | Path to the JSON schema file to register | |
575-
| `organization_name` | Positional | Name of the organization to register the schema under | |
576-
| `schema_name` | Positional | The name of the JSON schema | |
577-
| `--schema-version` | Named | Version of the schema to register (e.g., '0.0.1'). If not specified, auto-generated | None |
578-
| `--fix-schema-name` | Named | Replace dashes and underscores in the schema name with periods. | False |
572+
| Name | Type | Description | Default |
573+
|-----------------------|------------|--------------------------------------------------------------------------------------------------------|---------|
574+
| `schema_path` | Positional | Path to the JSON schema file to register | |
575+
| `organization_name` | Positional | Name of the organization to register the schema under | |
576+
| `schema_name` | Positional | The name of the JSON schema | |
577+
| `--schema-version` | Named | Version of the schema to register (e.g., '0.0.1'). If not specified, auto-generated | None |
578+
| `--fix-schema-name` | Named | Replaces dashes and underscores with periods in the schema name ('my-schema_name' -> 'my.schema.name') | False |
579579
580580
### `bind-json-schema`
581581

docs/tutorials/python/schema_operations.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This tutorial uses the Python client as a library. To use the CLI tool, see the
2121
## 1. Initial set up
2222

2323
```python
24-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=1-18}
24+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=1-28}
2525
```
2626

2727
To create a JSON Schema you need a data model, and the data types you want to create.
@@ -35,7 +35,7 @@ The data types must exist in your data model. This can be a list of data types,
3535
Create a JSON Schema
3636

3737
```python
38-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=20-27}
38+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=30-37}
3939
```
4040

4141
You should see the first JSON Schema for the datatype you selected printed.
@@ -47,7 +47,7 @@ By setting the `output` parameter as path to a "temp" directory, the file will b
4747
Create multiple JSON Schema
4848

4949
```python
50-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=30-36}
50+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=40-46}
5151
```
5252

5353
The `data_types` parameter is a list and can have multiple data types.
@@ -57,7 +57,7 @@ The `data_types` parameter is a list and can have multiple data types.
5757
Create every JSON Schema
5858

5959
```python
60-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=38-43}
60+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=48-53}
6161
```
6262

6363
If you don't set a `data_types` parameter a JSON Schema will be created for every data type in the data model.
@@ -67,7 +67,7 @@ If you don't set a `data_types` parameter a JSON Schema will be created for ever
6767
Create a JSON Schema
6868

6969
```python
70-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=45-51}
70+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=55-61}
7171
```
7272

7373
If you have only one data type and set the `output` parameter to a file path(ending in.json), the JSON Schema file will have that path.
@@ -77,7 +77,7 @@ If you have only one data type and set the `output` parameter to a file path(end
7777
Create a JSON Schema
7878

7979
```python
80-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=53-58}
80+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=63-68}
8181
```
8282

8383
If you don't set `output` parameter the JSON Schema file will be created in the current working directory.
@@ -87,7 +87,7 @@ If you don't set `output` parameter the JSON Schema file will be created in the
8787
Create a JSON Schema
8888

8989
```python
90-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=60-66}
90+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=70-76}
9191
```
9292

9393
You can have Curator format the property names and valid values in the JSON Schema. This will remove whitespace and special characters.
@@ -97,21 +97,24 @@ You can have Curator format the property names and valid values in the JSON Sche
9797
Once you've created a JSON Schema file, you can register it to a Synapse organization.
9898

9999
```python
100-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=68-76}
100+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=78-87}
101101
```
102102

103103
The `register_jsonschema` function:
104104
- Takes a path to your generated JSON Schema file
105105
- Registers it with the specified organization in Synapse
106106
- Returns the schema URI and a success message
107107
- You can optionally specify a version (e.g., "0.0.1") or let it auto-generate
108+
- The fix_schema_name argument replaces dashes and underscores with periods in the schema name
109+
- 'my-schema_name' -> 'my.schema.name'
110+
- defaults to False
108111

109112
## 9. Bind a JSON Schema to a Synapse Entity
110113

111114
After registering a schema, you can bind it to Synapse entities (files, folders, etc.) for metadata validation.
112115

113116
```python
114-
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=78-85}
117+
{!docs/tutorials/python/tutorial_scripts/schema_operations.py!lines=89-96}
115118
```
116119

117120
The `bind_jsonschema` function:

docs/tutorials/python/tutorial_scripts/schema_operations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
schema_name=SCHEMA_NAME,
8383
schema_version=SCHEMA_VERSION,
8484
synapse_client=syn,
85+
fix_schema_name=True,
8586
)
8687
print(f"Registered schema URI: {json_schema.uri}")
8788

0 commit comments

Comments
 (0)