Skip to content
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

[BUG] Failure to build master branch due to a failling test #2551

Closed
cvgaviao opened this issue Mar 30, 2019 · 3 comments
Closed

[BUG] Failure to build master branch due to a failling test #2551

cvgaviao opened this issue Mar 30, 2019 · 3 comments

Comments

@cvgaviao
Copy link

I have cloned the openapi-generator today in order to test it with a snapshot version of swagger-parser containing a patch to an issue that bitten my spec file: swagger-api/swagger-parser#1063

So, I have changed the swagger-parser version in the master pom and tried to build.

But I'm getting a failure in this test class: org.openapitools.codegen.java.JavaModelTest on both maven or eclipse testng run:


org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 1, Warning count: 0
Errors: 
	-attribute paths.'/pet/findByStatus'(get).parameters.[status].schemas.default is not of type `array`

	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:615)
	at org.openapitools.codegen.java.JavaModelTest.generateModel(JavaModelTest.java:1230)

@cvgaviao
Copy link
Author

Did some investigation in the failing method: generateModel().

Interesting to note that other tests are using petstore.yarn and no one is failing, but this test is using src/test/resources/3_0/petstore.json

Then I've converted this json into yaml and compared with the petstore.yarn in the master branch.

As I was suspecting the src/test/resources/3_0/petstore.json has a structure problem.

cvgaviao added a commit to cvgaviao/openapi-generator that referenced this issue Mar 30, 2019
the json structure was causing the test failure

Signed-off-by: Cristiano Gavião <[email protected]>
@cvgaviao
Copy link
Author

I successfully generated a code from my spec now, but in order to run the generator with latest swagger-parser was necessary to include explicitly this dependency in openapi-generator/modules/openapi-generator/pom.xml:

        <dependency>
            <groupId>io.swagger.parser.v3</groupId>
            <artifactId>swagger-parser</artifactId>
            <version>${swagger-parser-version}</version>
        </dependency>

@wing328
Copy link
Member

wing328 commented Apr 9, 2019

We just released 4.0.0-beta3. Can you try that when you've time? If it's still an issue, please let us know (closing the issue for the time being)

@wing328 wing328 closed this as completed Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants