Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5cb0824

Browse files
committed
Reference code API docs
1 parent9762b79 commit5cb0824

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed

‎docs/api/index.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
API Reference
2+
=============
3+
4+
Documentation with information of functions, classes or methods and all other parts of the OpenAPI-core public API.
5+
6+
..toctree::
7+
:maxdepth:1
8+
9+
openapi

‎docs/api/openapi.rst‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
`OpenAPI` class
2+
===============
3+
4+
..autoclass::openapi_core.OpenAPI
5+
:members:

‎docs/conf.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"sphinx.ext.intersphinx",
3939
"sphinx.ext.coverage",
4040
"sphinx.ext.viewcode",
41+
"sphinx_autodoc_typehints",
4142
"sphinx_immaterial",
4243
]
4344

‎docs/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ openapi-core
1111
customizations/index
1212
security
1313
extensions
14+
api/index
1415
contributing
1516

1617
Openapi-core is a Python library that adds client-side and server-side support

‎openapi_core/app.py‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,17 @@
7171

7272

7373
classOpenAPI:
74-
"""OpenAPI class."""
74+
"""`OpenAPI` application class, the main entrypoint class for OpenAPI-core.
75+
76+
Read more information, in the
77+
[OpenAPI-core docs for First Steps](https://openapi-core.readthedocs.io/#first-steps).
78+
79+
Import :class:`OpenAPI` class from the main `openapi_core` module::
80+
81+
from openapi_core import OpenAPI
82+
83+
app = OpenAPI(spec)
84+
"""
7585

7686
def__init__(
7787
self,
@@ -90,27 +100,31 @@ def __init__(
90100
deffrom_dict(
91101
cls,data:Schema,config:Optional[Config]=None
92102
)->"OpenAPI":
103+
"""Creates :class:`OpenAPI` class instance from a dictionary."""
93104
sp=SchemaPath.from_dict(data)
94105
returncls(sp,config=config)
95106

96107
@classmethod
97108
deffrom_path(
98109
cls,path:Path,config:Optional[Config]=None
99110
)->"OpenAPI":
111+
"""Creates :class:`OpenAPI` class instance from a path object."""
100112
sp=SchemaPath.from_path(path)
101113
returncls(sp,config=config)
102114

103115
@classmethod
104116
deffrom_file_path(
105117
cls,file_path:str,config:Optional[Config]=None
106118
)->"OpenAPI":
119+
"""Creates :class:`OpenAPI` class instance from a file path string."""
107120
sp=SchemaPath.from_file_path(file_path)
108121
returncls(sp,config=config)
109122

110123
@classmethod
111124
deffrom_file(
112125
cls,fileobj:SupportsRead,config:Optional[Config]=None
113126
)->"OpenAPI":
127+
"""Creates :class:`OpenAPI` class instance from a file object."""
114128
sp=SchemaPath.from_file(fileobj)
115129
returncls(sp,config=config)
116130

‎poetry.lock‎

Lines changed: 21 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ pyflakes = "^3.1.0"
112112
[tool.poetry.group.docs.dependencies]
113113
sphinx =">=5.3,<8.0"
114114
sphinx-immaterial ="^0.11.0"
115+
sphinx-autodoc-typehints ="^2.0.0"
115116

116117
[tool.pytest.ini_options]
117118
addopts ="""

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp