File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -57,18 +57,22 @@ Alternatively you can download the code and install from the repository:
57
57
Usage
58
58
#####
59
59
60
- Firstly create your specification:
60
+ Firstly create your specification object :
61
61
62
62
.. code-block :: python
63
63
64
+ from json import load
64
65
from openapi_core import create_spec
65
66
67
+ with open (' openapi.json' , ' r' ) as spec_file:
68
+ spec_dict = load(spec_file)
69
+
66
70
spec = create_spec(spec_dict)
67
71
68
72
Request
69
73
*******
70
74
71
- Now you can use it to validate requests
75
+ Now you can use it to validate against requests
72
76
73
77
.. code-block :: python
74
78
@@ -103,7 +107,7 @@ Request object should be instance of OpenAPIRequest class (See `Integrations <ht
103
107
Response
104
108
********
105
109
106
- You can also validate responses
110
+ You can also validate against responses
107
111
108
112
.. code-block :: python
109
113
Original file line number Diff line number Diff line change 1
1
Usage
2
2
=====
3
3
4
- Firstly create your specification:
5
-
6
- .. code-block :: python
4
+ Firstly create your specification: object
7
5
6
+ from json import load
8
7
from openapi_core import create_spec
9
8
9
+ with open('openapi.json', 'r') as spec_file:
10
+ spec_dict = load(spec_file)
11
+
10
12
spec = create_spec(spec_dict)
11
13
12
14
13
15
Request
14
16
-------
15
17
16
- Now you can use it to validate requests
18
+ Now you can use it to validate against requests
17
19
18
20
.. code-block :: python
19
21
@@ -48,7 +50,7 @@ Request object should be instance of OpenAPIRequest class (See :doc:`integration
48
50
Response
49
51
--------
50
52
51
- You can also validate responses
53
+ You can also validate against responses
52
54
53
55
.. code-block :: python
54
56
You can’t perform that action at this time.
0 commit comments