Skip to content

Commit 1e1d878

Browse files
authored
Merge pull request #911 from python-openapi/feature/md-documentation
Markdown documentation
2 parents 34372f7 + 9eb828d commit 1e1d878

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1791
-1769
lines changed

Diff for: .github/workflows/build-docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ jobs:
4242

4343
- name: Build documentation
4444
run: |
45-
poetry run python -m sphinx -T -b html -d docs/_build/doctrees -D language=en docs docs/_build/html -n -W
45+
poetry run python -m mkdocs build --clean --site-dir ./_build/html --config-file mkdocs.yml
4646
4747
- uses: actions/upload-artifact@v4
4848
name: Upload docs as artifact
4949
with:
5050
name: docs-html
51-
path: './docs/_build/html'
51+
path: './_build/html'
5252
if-no-files-found: error

Diff for: .readthedocs.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
33
version: 2
44

5-
# Build documentation in the docs/ directory with Sphinx
6-
sphinx:
7-
configuration: docs/conf.py
5+
# Build documentation with Mkdocs
6+
mkdocs:
7+
configuration: mkdocs.yml
88

99
# Optionally build your docs in additional formats such as PDF and ePub
1010
formats: all

Diff for: README.md

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# openapi-core
2+
3+
<a href="https://pypi.python.org/pypi/openapi-core" target="_blank">
4+
<img src="https://img.shields.io/pypi/v/openapi-core.svg" alt="Package version">
5+
</a>
6+
<a href="https://travis-ci.org/python-openapi/openapi-core" target="_blank">
7+
<img src="https://travis-ci.org/python-openapi/openapi-core.svg?branch=master" alt="Continuous Integration">
8+
</a>
9+
<a href="https://codecov.io/github/python-openapi/openapi-core?branch=master" target="_blank">
10+
<img src="https://img.shields.io/codecov/c/github/python-openapi/openapi-core/master.svg?style=flat" alt="Tests coverage">
11+
</a>
12+
<a href="https://pypi.python.org/pypi/openapi-core" target="_blank">
13+
<img src="https://img.shields.io/pypi/pyversions/openapi-core.svg" alt="Python versions">
14+
</a>
15+
<a href="https://pypi.python.org/pypi/openapi-core" target="_blank">
16+
<img src="https://img.shields.io/pypi/format/openapi-core.svg" alt="Package format">
17+
</a>
18+
<a href="https://pypi.python.org/pypi/openapi-core" target="_blank">
19+
<img src="https://img.shields.io/pypi/status/openapi-core.svg" alt="Development status">
20+
</a>
21+
22+
## About
23+
24+
Openapi-core is a Python library that adds client-side and server-side support
25+
for the [OpenAPI v3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md)
26+
and [OpenAPI v3.1](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md) specification.
27+
28+
29+
## Key features
30+
31+
- **Validation** and **unmarshalling** of request and response data (including webhooks)
32+
- **Integration** with popular libraries (Requests, Werkzeug) and frameworks (Django, Falcon, Flask, Starlette)
33+
- Customization with media type **deserializers** and format **unmarshallers**
34+
- **Security** data providers (API keys, Cookie, Basic and Bearer HTTP authentications)
35+
36+
37+
## Documentation
38+
39+
Check documentation to see more details about the features. All documentation is in the "docs" directory and online at [openapi-core.readthedocs.io](https://openapi-core.readthedocs.io)
40+
41+
42+
## Installation
43+
44+
Recommended way (via pip):
45+
46+
``` console
47+
pip install openapi-core
48+
```
49+
50+
Alternatively you can download the code and install from the repository:
51+
52+
``` console
53+
pip install -e git+https://github.com/python-openapi/openapi-core.git#egg=openapi_core
54+
```
55+
56+
57+
## First steps
58+
59+
Firstly create your OpenAPI object.
60+
61+
``` python
62+
from openapi_core import OpenAPI
63+
64+
openapi = OpenAPI.from_file_path('openapi.json')
65+
```
66+
67+
Now you can use it to validate and unmarshal against requests and/or responses.
68+
69+
``` python
70+
# raises error if request is invalid
71+
result = openapi.unmarshal_request(request)
72+
```
73+
74+
Retrieve validated and unmarshalled request data
75+
76+
``` python
77+
# get parameters
78+
path_params = result.parameters.path
79+
query_params = result.parameters.query
80+
cookies_params = result.parameters.cookies
81+
headers_params = result.parameters.headers
82+
# get body
83+
body = result.body
84+
# get security data
85+
security = result.security
86+
```
87+
88+
Request object should implement OpenAPI Request protocol. Check [Integrations](https://openapi-core.readthedocs.io/en/latest/integrations.html) to find officially supported implementations.
89+
90+
For more details read about [Unmarshalling](https://openapi-core.readthedocs.io/en/latest/unmarshalling.html) process.
91+
92+
If you just want to validate your request/response data without unmarshalling, read about [Validation](https://openapi-core.readthedocs.io/en/latest/validation.html) instead.
93+
94+
95+
## Related projects
96+
97+
- [openapi-spec-validator](https://github.com/python-openapi/openapi-spec-validator)
98+
: Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger), OpenAPI 3.0 and OpenAPI 3.1 specification. The validator aims to check for full compliance with the Specification.
99+
- [openapi-schema-validator](https://github.com/python-openapi/openapi-schema-validator)
100+
: Python library that validates schema against the OpenAPI Schema Specification v3.0 and OpenAPI Schema Specification v3.1.
101+
- [bottle-openapi-3](https://github.com/cope-systems/bottle-openapi-3)
102+
: OpenAPI 3.0 Support for the Bottle Web Framework
103+
- [pyramid_openapi3](https://github.com/niteoweb/pyramid_openapi3)
104+
: Pyramid addon for OpenAPI3 validation of requests and responses.
105+
- [tornado-openapi3](https://github.com/correl/tornado-openapi3)
106+
: Tornado OpenAPI 3 request and response validation library.
107+
108+
## License
109+
110+
The project is under the terms of BSD 3-Clause License.

Diff for: README.rst

-113
This file was deleted.

Diff for: docs/conf.py

-105
This file was deleted.

0 commit comments

Comments
 (0)