Skip to content

Commit

Permalink
docs: updates README to reflect SchemaConfiguration changes
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jan 12, 2023
1 parent 78e586a commit 587dadf
Showing 1 changed file with 67 additions and 13 deletions.
80 changes: 67 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,45 @@ cd ${UOR_CLIENT_GO_REPO}/exercises/schema

2. Create the Schema Configuration in a file called `schema-config.yaml` to define attribute keys and types for corresponding collections:

```bash
cat << EOF > animalschema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"animal": {
"type": "string"
},
"size": {
"type": "string"
},
"color": {
"type": "string"
},
"habitat": {
"type": "string"
},
"mammal": {
"type": "boolean"
}
},
"required": [
"animal",
"size",
"color",
"habitat",
"mammal"
]
}
EOF
```
```bash
cat << EOF > schema-config.yaml
kind: SchemaConfiguration
apiVersion: client.uor-framework.io/v1alpha1
schema:
id: myschemaid
attributeTypes:
"animal": string
"size": string
"color": string
"habitat": string
"mammal": boolean
schemaPath: animalschema.json
EOF
```

Expand Down Expand Up @@ -490,18 +517,45 @@ cd ${UOR_CLIENT_GO_REPO}/exercises/linked

2. Create a `schema-config.yaml` file with the following contents to define the schema for the collection:

```yaml
```bash
cat << EOF > animalschema.json
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"animal": {
"type": "string"
},
"size": {
"type": "string"
},
"color": {
"type": "string"
},
"habitat": {
"type": "string"
},
"mammal": {
"type": "boolean"
}
},
"required": [
"animal",
"size",
"color",
"habitat",
"mammal"
]
}
EOF
```
```bash
cat << EOF > schema-config.yaml
kind: SchemaConfiguration
apiVersion: client.uor-framework.io/v1alpha1
schema:
id: myschemaid
attributeTypes:
"animal": string
"size": string
"color": string
"habitat": string
"type": string
schemaPath: animalschema.json
EOF
```

Expand Down

0 comments on commit 587dadf

Please sign in to comment.