You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/complexTypes/object.rst
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,12 +93,15 @@ Naming
93
93
Naming of classes
94
94
^^^^^^^^^^^^^^^^^
95
95
96
-
If the given main object in a JSON-Schema file contains a `$id` the id will be used as class name. Otherwise the name of the file will be used.
96
+
If the given main object in a JSON-Schema file contains a `title`, the title will be used as class name.
97
+
Otherwise, if an `$id` is present, the basename of the $id and as a last fallback the name of the file will be used.
97
98
98
99
Naming of nested classes
99
100
^^^^^^^^^^^^^^^^^^^^^^^^
100
101
101
-
For the class name of a nested class the `$id` property of the nested object is used. If the id property isn't present the property key will be prefixed with the parent class. If an object `Person` has a nested object `car` without a `$id` the class for car will be named **Person_Car**.
102
+
For the class name of a nested class the `title` property (fallback to `$id`) of the nested object is used.
103
+
If neither the title nor the $id property is present the property key will be prefixed with the parent class.
104
+
If an object `Person` has a nested object `car` without a `title` and an `$id` the class for car will be named **Person_Car**.
Copy file name to clipboardExpand all lines: docs/source/generic/references.rst
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,20 @@ Supported reference types
11
11
* relative reference based on the location on the file system to a complete file (example: `"$ref": "./../modules/myObject.json"`)
12
12
* relative reference based on the location on the file system to an object by id (example: `"$ref": "./../modules/myObject.json#IdOfMyObject"`)
13
13
* relative reference based on the location on the file system to an object by path (example: `"$ref": "./../modules/myObject.json#/definitions/myObject"`)
14
+
* absolute reference based on the location on the file system to a complete file (example: `"$ref": "/modules/myObject.json"`)
15
+
* absolute reference based on the location on the file system to an object by id (example: `"$ref": "/modules/myObject.json#IdOfMyObject"`)
16
+
* absolute reference based on the location on the file system to an object by path (example: `"$ref": "/modules/myObject.json#/definitions/myObject"`)
14
17
* network reference to a complete file (example: `"$ref": "https://my.domain.com/schema/modules/myObject.json"`)
15
18
* network reference to an object by id (example: `"$ref": "https://my.domain.com/schema/modules/myObject.json#IdOfMyObject"`)
16
19
* network reference to an object by path (example: `"$ref": "https://my.domain.com/schema/modules/myObject.json#/definitions/myObject"`)
17
20
21
+
If an `$id` is present in the schema, the `$ref` will be resolved relative to the `$id` (except the `$ref` already is an absolute reference, e.g. a full URL).
22
+
The behaviour of `$ref` resolving can be overwritten by implementing a custom **SchemaProviderInterface**, for example when you want to use network references behind an authorization.
23
+
24
+
.. note::
25
+
26
+
For absolute local references, the default implementation traverses up the directory tree until it finds a matching file to find the project root
0 commit comments