File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,27 @@ Alternatively you can download the code and install from the repository:
3535
3636 $ pip install -e git+https://github.com/p1c2u/openapi-core.git#egg=openapi_core
3737
38+
39+ Usage
40+ =====
41+
42+ Firstly create your specification:
43+
44+ .. code-block :: python
45+
46+ from openapi_core import create_spec
47+
48+ spec = create_spec(spec_dict)
49+
50+ Now you can use it to validate and unmarshal requests
51+
52+ .. code-block :: python
53+
54+ from openapi_core import request_parameters_factory, request_body_factory
55+
56+ parameters = request_parameters_factory.create(request, spec)
57+ body = request_body_factory.create(request, spec)
58+
3859 Related projects
3960================
4061* `openapi-spec-validator <https://github.com/p1c2u/openapi-spec-validator >`__
Original file line number Diff line number Diff line change 11"""OpenAPI core module"""
22from openapi_core .shortcuts import create_spec
3+ from openapi_core .wrappers import RequestParametersFactory , RequestBodyFactory
34
45__author__ = 'Artur Maciąg'
56__email__ = 'maciag.artur@gmail.com'
67__version__ = '0.0.1'
78__url__ = 'https://github.com/p1c2u/openapi-core'
89__license__ = 'BSD 3-Clause License'
910
10- __all__ = ['create_spec' , ]
11+ __all__ = ['create_spec' , 'request_parameters_factory' , 'request_body_factory' ]
12+
13+ request_parameters_factory = RequestParametersFactory ()
14+ request_body_factory = RequestBodyFactory ()
You can’t perform that action at this time.
0 commit comments