File: cli.rst

package info (click to toggle)
python-openapi-spec-validator 0.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 772 kB
  • sloc: python: 2,050; makefile: 54
file content (49 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CLI (Command Line Interface)
============================

Executable
^^^^^^^^^^

   Straight forward way:

   .. code-block:: bash

      openapi-spec-validator openapi.yaml

   pipes way:

   .. code-block:: bash

      cat openapi.yaml | openapi-spec-validator -

Docker
^^^^^^

   .. code-block:: bash

      docker run -v path/to/openapi.yaml:/openapi.yaml --rm pythonopenapi/openapi-spec-validator /openapi.yaml

Python interpreter
^^^^^^^^^^^^^^^^^^

   .. code-block:: bash

      python -m openapi_spec_validator openapi.yaml

.. code-block:: bash

   usage: openapi-spec-validator [-h] [--errors {best-match,all}]
                                 [--schema {2.0,3.0.0,3.1.0,detect}]
                                 filename
   
   positional arguments:
     filename              Absolute or relative path to file
   
   options:
     -h, --help            show this help message and exit
     --errors {best-match,all}
                           Control error reporting. Defaults to "best-
                           match", use "all" to get all subschema
                           errors.
     --schema {2.0,3.0.0,3.1.0,detect}
                           OpenAPI schema (default: detect)