You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/server/petstore/python-fastapi/src/openapi_server/apis/pet_api.py
+26-13Lines changed: 26 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,8 @@
50
50
response_model_by_alias=True,
51
51
)
52
52
asyncdefupdate_pet(
53
-
pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")] =Body(..., description="Pet object that needs to be added to the store"),
53
+
pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")] =Body(..., description="Pet object that needs to be added to the store")
pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")] =Body(..., description="Pet object that needs to be added to the store"),
76
+
pet: Annotated[Pet, Field(description="Pet object that needs to be added to the store")] =Body(..., description="Pet object that needs to be added to the store")
status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")] =Query(..., description="Status values that need to be considered for filter", alias="status"),
99
+
status: Annotated[List[StrictStr], Field(description="Status values that need to be considered for filter")] =Query(..., description="Status values that need to be considered for filter", alias="status")
petId: Annotated[StrictInt, Field(description="ID of pet to update")] =Path(..., description="ID of pet to update"),
209
-
additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] =Form(None, description="Additional data to pass to server"),
210
-
file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] =Form(None, description="file to upload"),
218
+
petId: Annotated[StrictInt, Field(description="ID of pet to update")] =Path(..., description="ID of pet to update")
219
+
,
220
+
additional_metadata: Annotated[Optional[StrictStr], Field(description="Additional data to pass to server")] =Form(None, description="Additional data to pass to server")
221
+
,
222
+
file: Annotated[Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]], Field(description="file to upload")] =Form(None, description="file to upload")
Copy file name to clipboardExpand all lines: samples/server/petstore/python-fastapi/src/openapi_server/apis/store_api.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,8 @@ async def get_inventory(
67
67
response_model_by_alias=True,
68
68
)
69
69
asyncdefplace_order(
70
-
order: Annotated[Order, Field(description="order placed for purchasing the pet")] =Body(..., description="order placed for purchasing the pet"),
70
+
order: Annotated[Order, Field(description="order placed for purchasing the pet")] =Body(..., description="order placed for purchasing the pet")
71
+
,
71
72
) ->Order:
72
73
""""""
73
74
ifnotBaseStoreApi.subclasses:
@@ -87,7 +88,8 @@ async def place_order(
87
88
response_model_by_alias=True,
88
89
)
89
90
asyncdefget_order_by_id(
90
-
orderId: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")] =Path(..., description="ID of pet that needs to be fetched", ge=1, le=5),
91
+
orderId: Annotated[int, Field(le=5, strict=True, ge=1, description="ID of pet that needs to be fetched")] =Path(..., description="ID of pet that needs to be fetched", ge=1, le=5)
92
+
,
91
93
) ->Order:
92
94
"""For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions"""
93
95
ifnotBaseStoreApi.subclasses:
@@ -106,7 +108,8 @@ async def get_order_by_id(
106
108
response_model_by_alias=True,
107
109
)
108
110
asyncdefdelete_order(
109
-
orderId: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")] =Path(..., description="ID of the order that needs to be deleted"),
111
+
orderId: Annotated[StrictStr, Field(description="ID of the order that needs to be deleted")] =Path(..., description="ID of the order that needs to be deleted")
112
+
,
110
113
) ->None:
111
114
"""For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"""
username: Annotated[str, Field(strict=True, description="The user name for login")] =Query(..., description="The user name for login", alias="username", regex=r"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$"),
114
-
password: Annotated[StrictStr, Field(description="The password for login in clear text")] =Query(..., description="The password for login in clear text", alias="password"),
116
+
username: Annotated[str, Field(strict=True, description="The user name for login")] =Query(..., description="The user name for login", alias="username", regex=r"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$")
117
+
,
118
+
password: Annotated[StrictStr, Field(description="The password for login in clear text")] =Query(..., description="The password for login in clear text", alias="password")
119
+
,
115
120
) ->str:
116
121
""""""
117
122
ifnotBaseUserApi.subclasses:
@@ -151,7 +156,8 @@ async def logout_user(
151
156
response_model_by_alias=True,
152
157
)
153
158
asyncdefget_user_by_name(
154
-
username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")] =Path(..., description="The name that needs to be fetched. Use user1 for testing."),
159
+
username: Annotated[StrictStr, Field(description="The name that needs to be fetched. Use user1 for testing.")] =Path(..., description="The name that needs to be fetched. Use user1 for testing.")
160
+
,
155
161
) ->User:
156
162
""""""
157
163
ifnotBaseUserApi.subclasses:
@@ -170,8 +176,10 @@ async def get_user_by_name(
170
176
response_model_by_alias=True,
171
177
)
172
178
asyncdefupdate_user(
173
-
username: Annotated[StrictStr, Field(description="name that need to be deleted")] =Path(..., description="name that need to be deleted"),
174
-
user: Annotated[User, Field(description="Updated user object")] =Body(..., description="Updated user object"),
179
+
username: Annotated[StrictStr, Field(description="name that need to be deleted")] =Path(..., description="name that need to be deleted")
180
+
,
181
+
user: Annotated[User, Field(description="Updated user object")] =Body(..., description="Updated user object")
182
+
,
175
183
token_api_key: TokenModel=Security(
176
184
get_token_api_key
177
185
),
@@ -193,7 +201,8 @@ async def update_user(
193
201
response_model_by_alias=True,
194
202
)
195
203
asyncdefdelete_user(
196
-
username: Annotated[StrictStr, Field(description="The name that needs to be deleted")] =Path(..., description="The name that needs to be deleted"),
204
+
username: Annotated[StrictStr, Field(description="The name that needs to be deleted")] =Path(..., description="The name that needs to be deleted")
0 commit comments