Skip to content

Commit 8c044c5

Browse files
guillettcommonism
authored andcommitted
docs improve load_file
1 parent 53d25fe commit 8c044c5

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

aiopenapi3/openapi.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,19 @@ def load_file(
152152
"""
153153
Create an OpenAPI object from a description document file.
154154
155-
from pathlib import Path
156-
import aiopenapi3
157-
158-
api = aiopenapi3.OpenAPI.load_file("/",pathlib.Path("schema.yaml"), loader=aiopenapi3.FileSystemLoader(pathlib.Path("/tmp")), session_factory=httpx.Client)
155+
.. code-block:: python
156+
157+
from pathlib import Path
158+
import aiopenapi3
159+
import httpx
160+
161+
loader = aiopenapi3.FileSystemLoader(pathlib.Path("<root>"))
162+
api = aiopenapi3.OpenAPI.load_file(
163+
url="<live-url>",
164+
path=pathlib.Path("<path-relative-to-root>"),
165+
loader=loader,
166+
session_factory=httpx.Client
167+
)
159168
160169
161170
:param url: the fictive url of the description document

0 commit comments

Comments
 (0)