1
1
from openapi_core .compat import lru_cache
2
2
from openapi_core .schema .components .models import Components
3
+ from openapi_core .schema .extensions .generators import ExtensionsGenerator
3
4
from openapi_core .schema .schemas .generators import SchemasGenerator
4
5
from openapi_core .schema .security_schemes .generators import (
5
6
SecuritySchemesGenerator ,
@@ -21,6 +22,8 @@ def create(self, components_spec):
21
22
request_bodies_spec = components_deref .get ('requestBodies' , {})
22
23
security_schemes_spec = components_deref .get ('securitySchemes' , {})
23
24
25
+ extensions = self .extensions_generator .generate (components_deref )
26
+
24
27
schemas = self .schemas_generator .generate (schemas_spec )
25
28
responses = self ._generate_response (responses_spec )
26
29
parameters = self ._generate_parameters (parameters_spec )
@@ -30,13 +33,19 @@ def create(self, components_spec):
30
33
return Components (
31
34
schemas = list (schemas ), responses = responses , parameters = parameters ,
32
35
request_bodies = request_bodies , security_schemes = security_schemes ,
36
+ extensions = extensions ,
33
37
)
34
38
35
39
@property
36
40
@lru_cache ()
37
41
def schemas_generator (self ):
38
42
return SchemasGenerator (self .dereferencer , self .schemas_registry )
39
43
44
+ @property
45
+ @lru_cache ()
46
+ def extensions_generator (self ):
47
+ return ExtensionsGenerator (self .dereferencer )
48
+
40
49
def _generate_response (self , responses_spec ):
41
50
return responses_spec
42
51
0 commit comments