Skip to content

Commit 55b200d

Browse files
committed
extra - docs
1 parent b9d3272 commit 55b200d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

aiopenapi3/extra.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@
77

88

99
class Reduce(Document, Init):
10-
log = logging.getLogger("aiopenapi3.extra.Reduced")
10+
"""
11+
The Reduce plugin removes all not listed PathItems from the paths, limits initialization to models required and removes non required schemas
12+
"""
1113

12-
def __init__(self, operations: Dict[Union[str, Pattern], List[Union[str, Pattern]]]):
14+
log = logging.getLogger("aiopenapi3.extra.Reduce")
15+
16+
def __init__(self, operations: Dict[Union[str, Pattern], List[Union[str, Pattern]]]) -> None:
17+
"""
18+
:param operations: paths/methods to reduce to
19+
"""
1320
self.operations: List[Union[str, Pattern]] = operations
1421
super().__init__()
1522

@@ -73,6 +80,8 @@ def initialized(self, ctx: "Init.Context") -> "Init.Context":
7380

7481

7582
class Cull(Reduce):
83+
"""The Cull plugin removes everything not required as early as possible"""
84+
7685
@staticmethod
7786
def _extract_references(data, root=None):
7887
"""

docs/source/api.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ Cull & Reduce
351351
-------------
352352

353353
Reduce & Cull are Plugins limiting the models built to the minimum required to match the requirements of the supplied Operations
354-
355354
Code below will eleminate all schemas not required to serve the operations identified by the pattern/string match and http methods associated.
355+
356356
.. code:: python
357357
358358
api = OpenAPI.load_sync(
@@ -367,4 +367,5 @@ Code below will eleminate all schemas not required to serve the operations ident
367367
368368
.. currentmodule:: aiopenapi3.extra
369369
.. autoclass:: Reduce
370+
:members: __init__
370371
.. autoclass:: Cull

docs/source/extra.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Large Description Documents
1111
To assist working with large description documents it is possible to limit the models build to the minimum required.
1212
This "minimum required" by the requirements of the Operations.
1313

14-
Currently there is two Plugins to assist such reduction - :class:`aiopenapi3.extra.Reduce` and :class:`aiopenapi3.extra.Cull`.
14+
Currently there are two Plugins to assist such reduction - :class:`aiopenapi3.extra.Reduce` and :class:`aiopenapi3.extra.Cull`.
1515
Cull is faster, Reduce assists in debugging.
1616

1717
Large description documents which are autogenerated by converting other service description document formats -such as odata-
1818
may benefit from additional changes to the description document to eliminate conversion artifacts depending on the converter used.
1919

20-
As an example for additional steps based on the Microsoft MS Graph API refer to :aioai3:ref:`tests.extra_test.MSGraph`.
20+
As an example for additional steps based on the `Microsoft Graph API <https://github.com/microsoftgraph/msgraph-metadata>`_ refer to :aioai3:ref:`tests.extra_test.MSGraph`.

0 commit comments

Comments
 (0)