mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 12:27:45 +00:00
Save memory on unused schema strings (#1482)
Nodoby needs the schema strings vs. the parsed contents, yet those strings consume quite some memory for big specs.
This commit is contained in:
@@ -208,6 +208,7 @@ class Swagger2Specification(Specification):
|
|||||||
|
|
||||||
schema_string = pkg_resources.resource_string('connexion', 'resources/schemas/v2.0/schema.json')
|
schema_string = pkg_resources.resource_string('connexion', 'resources/schemas/v2.0/schema.json')
|
||||||
openapi_schema = json.loads(schema_string.decode('utf-8'))
|
openapi_schema = json.loads(schema_string.decode('utf-8'))
|
||||||
|
del schema_string
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _set_defaults(cls, spec):
|
def _set_defaults(cls, spec):
|
||||||
@@ -260,6 +261,7 @@ class OpenAPISpecification(Specification):
|
|||||||
|
|
||||||
schema_string = pkg_resources.resource_string('connexion', 'resources/schemas/v3.0/schema.json')
|
schema_string = pkg_resources.resource_string('connexion', 'resources/schemas/v3.0/schema.json')
|
||||||
openapi_schema = json.loads(schema_string.decode('utf-8'))
|
openapi_schema = json.loads(schema_string.decode('utf-8'))
|
||||||
|
del schema_string
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _set_defaults(cls, spec):
|
def _set_defaults(cls, spec):
|
||||||
|
|||||||
Reference in New Issue
Block a user