Skip to content

Commit 6f466cf

Browse files
authored
Merge pull request #119 from MattiSG/patch-1
Document Python validation of Swagger v2 specs
2 parents 51b791d + d3b0925 commit 6f466cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ or more pythonic way:
7373
Examples
7474
********
7575

76-
Validate spec:
76+
By default, OpenAPI v3 syntax is expected. To validate an OpenAPI v3 spec:
7777

7878
.. code:: python
7979
@@ -90,6 +90,8 @@ Validate spec:
9090
Traceback (most recent call last):
9191
...
9292
OpenAPIValidationError: 'openapi' is a required property
93+
94+
In order to validate a Swagger / OpenAPI 2.0 spec file, import ``validate_v2_spec`` instead of ``validate_spec``. You can also explicitly import ``validate_v3_spec`` if you want to disambiguate the expected version.
9395

9496
Add ``spec_url`` to validate spec with relative files:
9597

0 commit comments

Comments
 (0)