-
-
Notifications
You must be signed in to change notification settings - Fork 762
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: support openapi spec version 3 #591
Closed
Closed
Changes from all commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
eb374a6
Remove vendored swagger-ui, add swagger-ui-bundle as optional pip ext…
dtkav 24f87b8
use external swagger_ui_bundle package, remove vendored files
3ba56ff
bump swagger-ui-bundle version
51f9b77
isort
42f33c3
resolve README.rst
fae0073
options: basic support for oas3
c8da30d
split examples into swagger2 and openapi3
71fd269
switch to openapi-spec-validator for multi-version validation
db23361
change openapi3 spec default path to /openapi.json
8a648c7
initial support for requestBody
116e15c
add oas3 restyresolver example
0363876
bugfix for backwards compatability with swagger2
6bb7f95
support component parameters, empty server block
e5fc493
add sqlalchemy example for oas3
403f3c0
handle servers leading slash edge case
b7cb2ee
don't warn when using swagger2
78966e6
add oas3 basicauth example
e41a5ae
modify aio tests to load as a module, but not conflict with the aioht…
27ac875
add .pytest_cache to gitignore
4eec9e3
depend on dtkav/openapi-spec-validator until some bugs are merged ups…
38126ca
update oas3 sqlalchemy example to expect body arg, force single threa…
48b717d
pin Julian/jsonschema and depend on dtkav/openapi-spec-validator unti…
59c9bde
progress on oas3 requestBody support
7daa37d
somehow tests pass...
90ad783
setup.py can't handle github links
e187e8d
add fork notes
26b642a
Update README.rst
dtkav f26d5ee
push broken tests for JuxhinDB
cbb00f7
some progress
6c47b4d
fixes for mimetypes, and requestBody
793f85a
update fixture mimtypes and x-body-name field
421da82
fix up some tests, and remove tests for nested null properties
5cfddfd
fix responses
4717374
tests passing! what a mess!
6061a02
fix backwards compatability with swagger2 tests (must be selected in …
5f1f7d3
flake8
b6ebcd4
clean up operation.py
f319f26
single quotes...
27411e2
point back to p1c2u/openapi-spec-validator now that fixes are upstreamed
9b34a2f
sort imports
fdf00a9
move aiohttp tests back to where they were
74d0f11
parameterize fixtures to use both swagger and openapi specs
252b249
refactor spec version from options.py
7a413fa
fix restyresolver example
557bb86
fix ConnexionOptions reverting to swagger2, make tests more robust
e6550e1
fix isort
eb41f44
use x-body-name in sqlalchemy example
046e5ac
clean up spec version code
3f607a2
factor out HTTP form content types
1a92671
simplify spec reference resolution
ae716ff
remove bogus comment
fd161a0
be more specific about exception type in get_spec_version
fdb9ded
fix flake
defe386
factor out query parsing logic
f026c0b
make variable names consistent (defn, schema, type) and factor out oa…
1446290
flake
dcd6a12
isort..
779f5e8
more get_schema refactor
af80806
remove some notes to self
30fc488
use six for urlparse import
f667e51
remove typographical changes, better syntax for file validation
ab82d9c
remote more typographic changes
fb569e8
clean up is_nullable
9442502
isort..
a6af4c2
isort again
8d3a95e
remove typographic changes
bdcca24
shorten key names in parameters dict comprehensions
9fb513c
demo class separation
7645933
clean up whitespace
e715d74
remove mention of definitions from Operation
40c4c69
add example response to Operation classes
47d2b6b
remove logging, reformatting
b30f0d6
split test_operation by openapi version
0981638
port test_resolver to Operation
a4b364e
isort
4bd2085
try operations abstract base class
4e3ca05
isort
1d5f2eb
clean up responses api
7a2cd0b
refactor handlers.py to rely on SecureOperation only
9e33255
lots of duplicate code, but everything should be separated by classes...
0e8388a
fix test_injection test for python2.7
cc699b5
centralize query and path parsing and dedup
69419c1
whoops, forgot the query parser file
6ee2174
use abc
e5a92bb
fix some rebase errors
0f830cd
remove some debug logging
4495a77
Refactor query and path arrays parsing logic into decorator
3775496
cherry pick and adapt uri_parsing decorator from swagger2 branch
3bacff2
remove hardcoded swagger.json from path
8763251
remove debug logging from decorators/response.py
4bef3b7
remove unused constant from decorators/validation.py
1e351d3
remove per-version validators
1edf5e6
typo
4a99510
fix bug with oas3 spec examples (thanks @viralanomaly)
3df7ef9
flake
e1f18d2
isort
e52c75e
fixes from large rebase
fae3fb4
remove fork notes
9310335
codacy lint
3bf0a4c
fix up codacy error in response.py
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ htmlcov/ | |
*.swp | ||
.tox/ | ||
.idea/ | ||
.pytest_cache/ |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try:
spec['openapi'] or spec['swagger']
except (KeyError, AttributeError):
raise ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That has slightly different behavior. This block in my code is checking that (a) spec is a dictionary, and (b) getting the version string from either version of the spec.
Another way to do it would be to check against each version serially, but it's a bit more nested:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OT: @dtkav thank you very much for all your work in supporting OpenAPI v3 :)