Skip to content

Commit 02d8bc9

Browse files
Adding metadata information to documentation (#198)
1 parent 987093f commit 02d8bc9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

guides/reference-guides/schema.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,17 @@ A class definition includes several properties, and the keywords, prefixed `@`,
154154

155155
The `@type` of the object. At the schema level, this is one of: `Enum`, `Class`, `TaggedUnion` and `Unit`.
156156

157+
### @metadata
158+
159+
If you would like to add arbitrary JSON structured metadata to a class, you can place it in the `@metadata` field of the class. This can be used to direct various approaches to display of the class, or associated information for backend or front-ends which may have different requirements. It is generally good practice to keep important metadata one level deeper in a JSON object so as to leave space for other kinds of metadata. For instance:
160+
161+
```json
162+
{ "@type" : "Class",
163+
"@id" : "MyClass",
164+
"@metadata" : { "display_format" : { "colour" : "Blue", "size" : [100,400]}},
165+
"name" : "xsd:string" }
166+
```
167+
157168
#### Class
158169

159170
`Class` designates a standard class document. It contains the definition of several properties and keywords describing various class attributes. An example of a class, and an instance of the class:

0 commit comments

Comments
 (0)