-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schemas and validators lazy loading proxy
- Loading branch information
Showing
5 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
"""OpenAIP spec validator schemas module.""" | ||
from openapi_spec_validator.schemas.utils import get_schema | ||
from functools import partial | ||
|
||
from lazy_object_proxy import Proxy | ||
|
||
from openapi_spec_validator.schemas.utils import get_schema_content | ||
|
||
__all__ = ["schema_v2", "schema_v3", "schema_v30", "schema_v31"] | ||
|
||
schema_v2, _ = get_schema("2.0") | ||
schema_v30, _ = get_schema("3.0") | ||
schema_v31, _ = get_schema("3.1") | ||
get_schema_content_v2 = partial(get_schema_content, "2.0") | ||
get_schema_content_v30 = partial(get_schema_content, "3.0") | ||
get_schema_content_v31 = partial(get_schema_content, "3.1") | ||
|
||
schema_v2 = Proxy(get_schema_content_v2) | ||
schema_v30 = Proxy(get_schema_content_v30) | ||
schema_v31 = Proxy(get_schema_content_v31) | ||
|
||
# alias to the latest v3 version | ||
schema_v3 = schema_v31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters