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/extensions.rst
+22-2
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,35 @@ Extensions
4
4
x-model
5
5
-------
6
6
7
-
By default, objects are unmarshalled to dynamically created dataclasses. You can use your own dataclasses, pydantic models or models generated by third party generators (i.e. `datamodel-code-generator <https://github.com/koxudaxi/datamodel-code-generator>`__) by providing ``x-model`` property inside schema definition with location of your class.
7
+
By default, objects are unmarshalled to dictionaries. You can use dynamically created dataclasses.
8
8
9
9
.. code-block:: yaml
10
10
11
11
...
12
12
components:
13
13
schemas:
14
14
Coordinates:
15
-
x-model: foo.bar.Coordinates
15
+
x-model: Coordinates
16
+
type: object
17
+
required:
18
+
- lat
19
+
- lon
20
+
properties:
21
+
lat:
22
+
type: number
23
+
lon:
24
+
type: number
25
+
26
+
27
+
You can use your own dataclasses, pydantic models or models generated by third party generators (i.e. `datamodel-code-generator <https://github.com/koxudaxi/datamodel-code-generator>`__) by providing ``x-model-path`` property inside schema definition with location of your class.
0 commit comments