Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork137
Add additional meta data to schema and errors#120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
danielbradburn wants to merge8 commits intopython-openapi:masterChoose a base branch fromcrunchr:schema-additional-metadata
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
8 commits Select commitHold shift + click to select a range
1592c18
Store additional information in the schema (name and deref) and also …
danielbradburnd776676
added tests for InvalidFormat and InvalidSchema
danielbradburne534f23
add newline to test_schemas.py
danielbradburnbddc61e
ensure that all changes to raising errors are covered by tests
danielbradburnb7f2e33
fix linter errors
danielbradburn4456f58
added simple test that checks that each schema Exception type can be …
danielbradburndf697c9
actually instantiate exception_type in exception test
danielbradburn9969e6c
removed unused import
danielbradburnFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
19 changes: 18 additions & 1 deletionopenapi_core/schema/schemas/exceptions.py
This file contains hidden or 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
3 changes: 2 additions & 1 deletionopenapi_core/schema/schemas/factories.py
This file contains hidden or 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
2 changes: 1 addition & 1 deletionopenapi_core/schema/schemas/generators.py
This file contains hidden or 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
101 changes: 62 additions & 39 deletionsopenapi_core/schema/schemas/models.py
Large diffs are not rendered by default.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
6 changes: 3 additions & 3 deletionsopenapi_core/schema/schemas/registries.py
This file contains hidden or 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
3 changes: 2 additions & 1 deletionrequirements_dev.txt
This file contains hidden or 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 |
---|---|---|
@@ -2,4 +2,5 @@ mock==2.0.0 | ||
pytest==3.5.0 | ||
pytest-flake8 | ||
pytest-cov==2.5.1 | ||
flask | ||
ruamel.yaml==0.15.89 |
27 changes: 27 additions & 0 deletionstests/unit/schema/test_exceptions.py
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from openapi_core.schema.schemas import exceptions | ||
import pytest | ||
import attr | ||
def is_open_api_exception(exception_type): | ||
try: | ||
return issubclass(exception_type, exceptions.OpenAPISchemaError) | ||
except TypeError: | ||
return False | ||
class TestExceptions: | ||
@pytest.mark.parametrize( | ||
"exception_type", | ||
( | ||
exception_type | ||
for exception_type_name in dir(exceptions) | ||
for exception_type in [getattr(exceptions, exception_type_name)] | ||
if is_open_api_exception(exception_type) | ||
) | ||
) | ||
def test_convert_to_string(self, exception_type): | ||
# verify that we can convert to a string without error | ||
args = ['x'] * len(attr.fields(exception_type)) | ||
str(exception_type(*args)) |
89 changes: 79 additions & 10 deletionstests/unit/schema/test_schemas.py
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.