5
5
from .exceptions import RequestValidationError
6
6
from .exceptions import ResponseValidationError
7
7
from .wrappers import PyramidOpenAPIRequest
8
- from openapi_core import Spec
8
+ from jsonschema_path import SchemaPath
9
9
from openapi_core .unmarshalling .request import V30RequestUnmarshaller
10
10
from openapi_core .unmarshalling .response import V30ResponseUnmarshaller
11
11
from openapi_core .validation .request .exceptions import SecurityValidationError
@@ -235,7 +235,7 @@ def register() -> None:
235
235
spec_dict , _ = read_from_filename (filepath )
236
236
237
237
validate (spec_dict )
238
- spec = Spec .from_dict (spec_dict )
238
+ spec = SchemaPath .from_dict (spec_dict )
239
239
240
240
def spec_view (request : Request ) -> FileResponse :
241
241
return FileResponse (filepath , request = request , content_type = "text/yaml" )
@@ -287,7 +287,7 @@ def register() -> None:
287
287
spec_dict , _ = read_from_filename (str (path ))
288
288
spec_url = path .as_uri ()
289
289
validate (spec_dict , base_uri = spec_url )
290
- spec = Spec .from_dict (spec_dict , base_uri = spec_url )
290
+ spec = SchemaPath .from_dict (spec_dict , base_uri = spec_url )
291
291
292
292
config .add_static_view (route , str (path .parent ), permission = permission )
293
293
config .add_route (route_name , f"{ route } /{ path .name } " )
@@ -303,7 +303,7 @@ def register() -> None:
303
303
304
304
305
305
def _create_api_settings (
306
- config : Configurator , filepath : str , route_name : str , spec : Spec
306
+ config : Configurator , filepath : str , route_name : str , spec : SchemaPath
307
307
) -> t .Dict :
308
308
custom_formatters = config .registry .settings .get ("pyramid_openapi3_formatters" )
309
309
custom_deserializers = config .registry .settings .get (
@@ -438,7 +438,7 @@ def remove_prefixes(path: str) -> str:
438
438
settings ["pyramid_openapi3" ]["routes" ][route_name ] = name
439
439
440
440
441
- def _get_server_prefixes (spec : Spec ) -> t .List [str ]:
441
+ def _get_server_prefixes (spec : SchemaPath ) -> t .List [str ]:
442
442
"""Build a set of possible route prefixes from the api spec.
443
443
444
444
Api routes may optionally be prefixed using servers (e.g: `/api/v1`).
0 commit comments