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

Commita11f10e

Browse files
committed
Path finder cls configuration
1 parentb804019 commita11f10e

File tree

15 files changed

+334
-155
lines changed

15 files changed

+334
-155
lines changed

‎openapi_core/app.py‎

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""OpenAPI core app module"""
22

3+
fromfunctoolsimportcached_property
34
frompathlibimportPath
45
fromtypingimportOptional
56

@@ -142,55 +143,55 @@ def check_spec(self) -> None:
142143
defversion(self)->SpecVersion:
143144
returnself._get_version()
144145

145-
@property
146+
@cached_property
146147
defrequest_validator_cls(self)->Optional[RequestValidatorType]:
147148
ifnotisinstance(self.config.request_validator_cls,Unset):
148149
returnself.config.request_validator_cls
149150
returnREQUEST_VALIDATORS.get(self.version)
150151

151-
@property
152+
@cached_property
152153
defresponse_validator_cls(self)->Optional[ResponseValidatorType]:
153154
ifnotisinstance(self.config.response_validator_cls,Unset):
154155
returnself.config.response_validator_cls
155156
returnRESPONSE_VALIDATORS.get(self.version)
156157

157-
@property
158+
@cached_property
158159
defwebhook_request_validator_cls(
159160
self,
160161
)->Optional[WebhookRequestValidatorType]:
161162
ifnotisinstance(self.config.webhook_request_validator_cls,Unset):
162163
returnself.config.webhook_request_validator_cls
163164
returnWEBHOOK_REQUEST_VALIDATORS.get(self.version)
164165

165-
@property
166+
@cached_property
166167
defwebhook_response_validator_cls(
167168
self,
168169
)->Optional[WebhookResponseValidatorType]:
169170
ifnotisinstance(self.config.webhook_response_validator_cls,Unset):
170171
returnself.config.webhook_response_validator_cls
171172
returnWEBHOOK_RESPONSE_VALIDATORS.get(self.version)
172173

173-
@property
174+
@cached_property
174175
defrequest_unmarshaller_cls(self)->Optional[RequestUnmarshallerType]:
175176
ifnotisinstance(self.config.request_unmarshaller_cls,Unset):
176177
returnself.config.request_unmarshaller_cls
177178
returnREQUEST_UNMARSHALLERS.get(self.version)
178179

179-
@property
180+
@cached_property
180181
defresponse_unmarshaller_cls(self)->Optional[ResponseUnmarshallerType]:
181182
ifnotisinstance(self.config.response_unmarshaller_cls,Unset):
182183
returnself.config.response_unmarshaller_cls
183184
returnRESPONSE_UNMARSHALLERS.get(self.version)
184185

185-
@property
186+
@cached_property
186187
defwebhook_request_unmarshaller_cls(
187188
self,
188189
)->Optional[WebhookRequestUnmarshallerType]:
189190
ifnotisinstance(self.config.webhook_request_unmarshaller_cls,Unset):
190191
returnself.config.webhook_request_unmarshaller_cls
191192
returnWEBHOOK_REQUEST_UNMARSHALLERS.get(self.version)
192193

193-
@property
194+
@cached_property
194195
defwebhook_response_unmarshaller_cls(
195196
self,
196197
)->Optional[WebhookResponseUnmarshallerType]:
@@ -200,7 +201,7 @@ def webhook_response_unmarshaller_cls(
200201
returnself.config.webhook_response_unmarshaller_cls
201202
returnWEBHOOK_RESPONSE_UNMARSHALLERS.get(self.version)
202203

203-
@property
204+
@cached_property
204205
defrequest_validator(self)->RequestValidator:
205206
ifself.request_validator_clsisNone:
206207
raiseSpecError("Validator class not found")
@@ -211,13 +212,14 @@ def request_validator(self) -> RequestValidator:
211212
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
212213
schema_casters_factory=self.config.schema_casters_factory,
213214
schema_validators_factory=self.config.schema_validators_factory,
215+
path_finder_cls=self.config.apicall_path_finder_cls,
214216
spec_validator_cls=self.config.spec_validator_cls,
215217
extra_format_validators=self.config.extra_format_validators,
216218
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
217219
security_provider_factory=self.config.security_provider_factory,
218220
)
219221

220-
@property
222+
@cached_property
221223
defresponse_validator(self)->ResponseValidator:
222224
ifself.response_validator_clsisNone:
223225
raiseSpecError("Validator class not found")
@@ -228,12 +230,13 @@ def response_validator(self) -> ResponseValidator:
228230
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
229231
schema_casters_factory=self.config.schema_casters_factory,
230232
schema_validators_factory=self.config.schema_validators_factory,
233+
path_finder_cls=self.config.apicall_path_finder_cls,
231234
spec_validator_cls=self.config.spec_validator_cls,
232235
extra_format_validators=self.config.extra_format_validators,
233236
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
234237
)
235238

236-
@property
239+
@cached_property
237240
defwebhook_request_validator(self)->WebhookRequestValidator:
238241
ifself.webhook_request_validator_clsisNone:
239242
raiseSpecError("Validator class not found")
@@ -244,13 +247,14 @@ def webhook_request_validator(self) -> WebhookRequestValidator:
244247
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
245248
schema_casters_factory=self.config.schema_casters_factory,
246249
schema_validators_factory=self.config.schema_validators_factory,
250+
path_finder_cls=self.config.webhook_path_finder_cls,
247251
spec_validator_cls=self.config.spec_validator_cls,
248252
extra_format_validators=self.config.extra_format_validators,
249253
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
250254
security_provider_factory=self.config.security_provider_factory,
251255
)
252256

253-
@property
257+
@cached_property
254258
defwebhook_response_validator(self)->WebhookResponseValidator:
255259
ifself.webhook_response_validator_clsisNone:
256260
raiseSpecError("Validator class not found")
@@ -261,12 +265,13 @@ def webhook_response_validator(self) -> WebhookResponseValidator:
261265
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
262266
schema_casters_factory=self.config.schema_casters_factory,
263267
schema_validators_factory=self.config.schema_validators_factory,
268+
path_finder_cls=self.config.webhook_path_finder_cls,
264269
spec_validator_cls=self.config.spec_validator_cls,
265270
extra_format_validators=self.config.extra_format_validators,
266271
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
267272
)
268273

269-
@property
274+
@cached_property
270275
defrequest_unmarshaller(self)->RequestUnmarshaller:
271276
ifself.request_unmarshaller_clsisNone:
272277
raiseSpecError("Unmarshaller class not found")
@@ -277,6 +282,7 @@ def request_unmarshaller(self) -> RequestUnmarshaller:
277282
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
278283
schema_casters_factory=self.config.schema_casters_factory,
279284
schema_validators_factory=self.config.schema_validators_factory,
285+
path_finder_cls=self.config.apicall_path_finder_cls,
280286
spec_validator_cls=self.config.spec_validator_cls,
281287
extra_format_validators=self.config.extra_format_validators,
282288
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
@@ -285,7 +291,7 @@ def request_unmarshaller(self) -> RequestUnmarshaller:
285291
extra_format_unmarshallers=self.config.extra_format_unmarshallers,
286292
)
287293

288-
@property
294+
@cached_property
289295
defresponse_unmarshaller(self)->ResponseUnmarshaller:
290296
ifself.response_unmarshaller_clsisNone:
291297
raiseSpecError("Unmarshaller class not found")
@@ -296,14 +302,15 @@ def response_unmarshaller(self) -> ResponseUnmarshaller:
296302
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
297303
schema_casters_factory=self.config.schema_casters_factory,
298304
schema_validators_factory=self.config.schema_validators_factory,
305+
path_finder_cls=self.config.apicall_path_finder_cls,
299306
spec_validator_cls=self.config.spec_validator_cls,
300307
extra_format_validators=self.config.extra_format_validators,
301308
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
302309
schema_unmarshallers_factory=self.config.schema_unmarshallers_factory,
303310
extra_format_unmarshallers=self.config.extra_format_unmarshallers,
304311
)
305312

306-
@property
313+
@cached_property
307314
defwebhook_request_unmarshaller(self)->WebhookRequestUnmarshaller:
308315
ifself.webhook_request_unmarshaller_clsisNone:
309316
raiseSpecError("Unmarshaller class not found")
@@ -314,6 +321,7 @@ def webhook_request_unmarshaller(self) -> WebhookRequestUnmarshaller:
314321
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
315322
schema_casters_factory=self.config.schema_casters_factory,
316323
schema_validators_factory=self.config.schema_validators_factory,
324+
path_finder_cls=self.config.webhook_path_finder_cls,
317325
spec_validator_cls=self.config.spec_validator_cls,
318326
extra_format_validators=self.config.extra_format_validators,
319327
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
@@ -322,7 +330,7 @@ def webhook_request_unmarshaller(self) -> WebhookRequestUnmarshaller:
322330
extra_format_unmarshallers=self.config.extra_format_unmarshallers,
323331
)
324332

325-
@property
333+
@cached_property
326334
defwebhook_response_unmarshaller(self)->WebhookResponseUnmarshaller:
327335
ifself.webhook_response_unmarshaller_clsisNone:
328336
raiseSpecError("Unmarshaller class not found")
@@ -333,6 +341,7 @@ def webhook_response_unmarshaller(self) -> WebhookResponseUnmarshaller:
333341
media_type_deserializers_factory=self.config.media_type_deserializers_factory,
334342
schema_casters_factory=self.config.schema_casters_factory,
335343
schema_validators_factory=self.config.schema_validators_factory,
344+
path_finder_cls=self.config.webhook_path_finder_cls,
336345
spec_validator_cls=self.config.spec_validator_cls,
337346
extra_format_validators=self.config.extra_format_validators,
338347
extra_media_type_deserializers=self.config.extra_media_type_deserializers,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fromopenapi_core.templating.paths.findersimportAPICallPathFinder
2+
fromopenapi_core.templating.paths.findersimportWebhookPathFinder
3+
4+
__all__= [
5+
"APICallPathFinder",
6+
"WebhookPathFinder",
7+
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp