Skip to content

upgrade swagger-parser to latest version#18436

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
ctreatma:upgrade-swagger-parser
May 9, 2024
Merged

upgrade swagger-parser to latest version#18436
wing328 merged 2 commits intoOpenAPITools:masterfrom
ctreatma:upgrade-swagger-parser

Conversation

@ctreatma
Copy link
Copy Markdown
Contributor

This upgrades swagger-parser to the latest release. In manual testing, this upgrade restored the generator's ability to resolve external references in OpenAPI specs.

Fixes #18429

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh ./bin/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH)
    Commit all changed files.
    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*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.1.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@wing328
Copy link
Copy Markdown
Member

wing328 commented Apr 22, 2024

thanks for the PR.

i'm looking into the gradle test issues

updating gradle to latest 7.x and 8.x didn't help as shown in #18300

i'll try to contact Gradle team to see if they can help.

@ctreatma ctreatma force-pushed the upgrade-swagger-parser branch from 50b1b44 to ba6b98c Compare April 25, 2024 19:30
@ctreatma ctreatma force-pushed the upgrade-swagger-parser branch from ba6b98c to ad1c88c Compare May 7, 2024 20:39
@ctreatma ctreatma requested a review from jimschubert as a code owner May 7, 2024 21:59
@ctreatma
Copy link
Copy Markdown
Contributor Author

ctreatma commented May 8, 2024

Tests are still failing with this error. It could be a gradle bug but it feels like something else; note that the jackson version in the error message is 2.17.0, but this PR updates from 2.15.3 to 2.16.2. I don't know where the 2.17.0 requirement is coming from.

Test: Test method openApiGenerate should reuse configuration cache[0](8.1.1)(org.openapitools.generator.gradle.plugin.GenerateTaskConfigurationCacheTest) produced standard out/err: java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file D:\a\openapi-generator\openapi-generator\modules\openapi-generator-gradle-plugin\build\tmp\test\work\.gradle-test-kit\caches\jars-9\970b4f5233619a1f72a6b180050ad4b0\jackson-core-2.17.0.jar.

@ctreatma ctreatma force-pushed the upgrade-swagger-parser branch from 66abe49 to 09949e9 Compare May 8, 2024 16:02
@ctreatma ctreatma force-pushed the upgrade-swagger-parser branch from 09949e9 to 51a2a5b Compare May 8, 2024 17:26
@ctreatma
Copy link
Copy Markdown
Contributor Author

ctreatma commented May 8, 2024

Found some additional places to upgrade gradle versions and all checks are passing now. @wing328 could you take a look?

@wing328
Copy link
Copy Markdown
Member

wing328 commented May 9, 2024

nice 👍

i'll take another later today

@wing328 wing328 added this to the 7.6.0 milestone May 9, 2024
@wing328
Copy link
Copy Markdown
Member

wing328 commented May 9, 2024

looks good. let's give it a try

@wing328 wing328 merged commit 75dd531 into OpenAPITools:master May 9, 2024
@wing328
Copy link
Copy Markdown
Member

wing328 commented May 10, 2024

saw the following in travis ci:

e: /home/travis/build/OpenAPITools/openapi-generator/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt: (746, 28): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

full log: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/270381537

can you please take a look when you've time?

@ctreatma ctreatma deleted the upgrade-swagger-parser branch May 10, 2024 14:50
@wing328 wing328 mentioned this pull request May 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] openapi-generator 7.5.0 is no longer able to resolve local $refs

2 participants