Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions aiopenapi3/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,19 @@ def load_file(
"""
Create an OpenAPI object from a description document file.

from pathlib import Path
import aiopenapi3

api = aiopenapi3.OpenAPI.load_file("/",pathlib.Path("schema.yaml"), loader=aiopenapi3.FileSystemLoader(pathlib.Path("/tmp")), session_factory=httpx.Client)
.. code-block:: python

from pathlib import Path
import aiopenapi3
import httpx

loader = aiopenapi3.FileSystemLoader(pathlib.Path("<root>"))
api = aiopenapi3.OpenAPI.load_file(
url="<live-url>",
path=pathlib.Path("<path-relative-to-root>"),
loader=loader,
session_factory=httpx.Client
)


:param url: the fictive url of the description document
Expand Down