-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Adds openapi v3.0.3 unit test spec, includes test cases, autogenerates model tests with them #12619
Merged
spacether
merged 43 commits into
OpenAPITools:master
from
spacether:feat_adds_unit_test_spec
Jul 1, 2022
Merged
Adds openapi v3.0.3 unit test spec, includes test cases, autogenerates model tests with them #12619
spacether
merged 43 commits into
OpenAPITools:master
from
spacether:feat_adds_unit_test_spec
Jul 1, 2022
Conversation
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
spacether
force-pushed
the
feat_adds_unit_test_spec
branch
from
June 21, 2022 05:06
537cf51
to
2624882
Compare
spacether
force-pushed
the
feat_adds_unit_test_spec
branch
from
June 21, 2022 05:07
2624882
to
9feb1e4
Compare
spacether
changed the title
Adds 3.0.3 unit test spec
Adds openapi v3.0.3 unit test spec
Jun 28, 2022
spacether
changed the title
Adds openapi v3.0.3 unit test spec
Adds openapi v3.0.3 unit test spec which includes test cases
Jun 28, 2022
Closed
6 tasks
6 tasks
spacether
added
Client: Python
Enhancement: CI/Test
Feature: OAS 3.0 spec support
Bleeding Edge
Experimental features (e.g. non-standard spec, "futures", or IETF draft)
labels
Jun 30, 2022
wing328
reviewed
Jun 30, 2022
modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java
Outdated
Show resolved
Hide resolved
wing328
reviewed
Jun 30, 2022
modules/openapi-generator/src/main/java/org/openapitools/codegen/ObjectWithTypeBooleans.java
Show resolved
Hide resolved
spacether
changed the title
Adds openapi v3.0.3 unit test spec which includes test cases
Adds openapi v3.0.3 unit test spec, includes test cases, autogenerates model tests with them
Jul 1, 2022
6 tasks
Golang team, are any of you interested in generating a golang client using this new unit tests spec? It could automatically run the included test cases in model test and verify your supported feature set. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bleeding Edge
Experimental features (e.g. non-standard spec, "futures", or IETF draft)
Client: Python
Enhancement: CI/Test
Feature: OAS 3.0 spec support
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.
What Is This
This PR adds an auto generated openpai v3.0.3 spec document which includes schemas and tests from Json Schema Draft6 tests
That spec is used to auto generate a python client using the python-experimental generator
That client includes the auto generated tests that came from the json schema test suite
Those tests are run in our CI (in node 4) to verify that the json schema features are working correctly in component schemas for the python-experimental generator.
Why Do This
Because our petstore spec is not the best way to unit test our features. We need a more basic unit test spec which includes json schema and openapi feature tests. This is that spec.
Why Put The tests In components.x-schema-test-examples
There are a number of places one could put the tests case data. They are:
true
orfalse
in v3.1.0 so one could not have that and useSomeComponent.x-schema-test-examples
Details
When writing this PR, I found bugs in swagger-parser that block generating correct code or successfully running some unit tests:
Python-experimental Improvements
Proposed Future Work (out of scope)
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(6.0.1) (patch release),6.1.x
(breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks)