Skip to content

Commit a950fa7

Browse files
author
Maxim Avanov
committed
update readme
1 parent dc0a5d9 commit a950fa7

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

README.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ OpenAPI Type
2424

2525
OpenAPI specification represented as a Python type. Use it to parse specifications written in JSON and YAML formats.
2626

27+
.. code:: bash
28+
29+
pip install openapi-type
30+
31+
32+
.. code:: python
33+
34+
from openapi_type import OpenAPI, parse_spec, serialize_spec
35+
36+
37+
spec: OpenAPI = parse_spec({
38+
"your OpenAPI Spec as Python dictionary": "will be parsed into a proper Python type"
39+
})
40+
assert parse_spec(serialize_spec(spec)) == spec
41+
42+
2743
Cloning this repo
2844
-----------------
2945

@@ -52,9 +68,9 @@ Test framework
5268

5369
Run existing test suite with
5470

55-
.. code::
71+
.. code:: bash
5672
57-
$ nix-shell --run "make test"
73+
nix-shell --run "make test"
5874
5975
6076
Changelog

docs/index.rst

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,26 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6-
OpenAPI Client Generator for Python
7-
===================================
6+
OpenAPI Type for Python
7+
=======================
8+
9+
**openapi-type** provides the `OpenAPI Specification <https://github.com/OAI/OpenAPI-Specification>`_ as a Python type.
10+
11+
.. code-block:: bash
12+
13+
pip install openapi-type
14+
15+
16+
.. code-block:: python
17+
18+
from openapi_type import OpenAPI, parse_spec, serialize_spec
19+
20+
21+
spec: OpenAPI = parse_spec({
22+
"your OpenAPI Spec as Python dictionary": "will be parsed into a proper Python type"
23+
})
24+
assert parse_spec(serialize_spec(spec)) == spec
825
9-
**openapi-type**
1026
1127
Quickstart Guide
1228
================

0 commit comments

Comments
 (0)