Skip to content

Commit 097aba9

Browse files
committed
More specific spec file loading in README
1 parent 2b327dd commit 097aba9

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

README.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,22 @@ Alternatively you can download the code and install from the repository:
5757
Usage
5858
#####
5959

60-
Firstly create your specification:
60+
Firstly create your specification object:
6161

6262
.. code-block:: python
6363
64+
from json import load
6465
from openapi_core import create_spec
6566
67+
with open('openapi.json', 'r') as spec_file:
68+
spec_dict = load(spec_file)
69+
6670
spec = create_spec(spec_dict)
6771
6872
Request
6973
*******
7074

71-
Now you can use it to validate requests
75+
Now you can use it to validate against requests
7276

7377
.. code-block:: python
7478
@@ -103,7 +107,7 @@ Request object should be instance of OpenAPIRequest class (See `Integrations <ht
103107
Response
104108
********
105109

106-
You can also validate responses
110+
You can also validate against responses
107111

108112
.. code-block:: python
109113

docs/usage.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
Usage
22
=====
33

4-
Firstly create your specification:
5-
6-
.. code-block:: python
4+
Firstly create your specification: object
75

6+
from json import load
87
from openapi_core import create_spec
98

9+
with open('openapi.json', 'r') as spec_file:
10+
spec_dict = load(spec_file)
11+
1012
spec = create_spec(spec_dict)
1113

1214

1315
Request
1416
-------
1517

16-
Now you can use it to validate requests
18+
Now you can use it to validate against requests
1719

1820
.. code-block:: python
1921
@@ -48,7 +50,7 @@ Request object should be instance of OpenAPIRequest class (See :doc:`integration
4850
Response
4951
--------
5052

51-
You can also validate responses
53+
You can also validate against responses
5254

5355
.. code-block:: python
5456

0 commit comments

Comments
 (0)