Skip to content

Modernize build: Java 17+, OAS 3.1 schema validation, CI matrix cleanup#507

Draft
xtina wants to merge 27 commits into
swagger-api:masterfrom
xtina:master
Draft

Modernize build: Java 17+, OAS 3.1 schema validation, CI matrix cleanup#507
xtina wants to merge 27 commits into
swagger-api:masterfrom
xtina:master

Conversation

@xtina

@xtina xtina commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Drop Java 8/11 support; build and publish on Java 17/21/25
  • Add OpenAPI 3.1 schema validation support (JSON Schema Draft 2020-12) alongside existing OAS 3.0 (Draft-04) path
  • Convert OAS 3.0 nullable to type: [T, null] for correct Draft-04 validation
  • Add SchemaValidatorTest covering convertNullableForDraft04 edge cases
  • Fix classpath split: exclude duplicate javax.xml.bind:jaxb-api pulled via jackson-module-jaxb-annotations
  • Remove stale java.sun.com javadoc links that cause redirect errors on Java 25
  • Bump SLF4J to 2.0.16 to match logback 1.5.x; add logback-test.xml for test output
  • Update enforcer requireJavaVersion from 1.8 to [17,)
  • Fix ${projects.version} typo in v1 CI workflows (deploy condition was always skipped)
  • Swap temurinzulu JDK distribution across all workflows; use setup-java Maven cache
  • Add Javadoc to all classes in config/ package

Test plan

  • All 230 unit tests + 74 integration tests pass (mvn verify)
  • Verify CI matrix runs on Java 17, 21, 25
  • Confirm no StaticLoggerBinder SLF4J warning in test output
  • Confirm no scanned from multiple locations warning for javax.xml.bind
  • Confirm snapshot deploy fires only on Java 17 matrix leg

xtina and others added 27 commits January 8, 2026 17:15
…gin-version property

- Remove duplicate maven-gpg-plugin declaration in pluginManagement
- Replace undefined ${enforcer-plugin-version} with explicit version 3.4.1
- Fixes Maven build validation errors
- Add fork detection check using github.repository context
- Skip Maven Central deployment for forks (e.g., xtina/swagger-inflector)
- Still run build and tests for forks, only skip deploy step
- Prevents deployment failures when running workflow on forks
- Add explicit 'Run tests' step that runs mvn test for all Java versions
- Add Java 17 and 21 to the build matrix (now supports 8, 11, 17, 21)
- Update build step to run integration tests via mvn verify -DskipTests
- Tests now run explicitly before build/deploy steps for better visibility
- Replace all mvn commands with ./mvnw in workflow
- Ensures consistent Maven version across all environments
- Uses project's Maven Wrapper for reproducible builds
- Remove redundant --file pom.xml flags from mvnw commands
- Add step to explicitly make mvnw executable in workflow
- Fixes warnings in GitHub Actions workflow
Forks don't have security-events API access, so uploading results fails.
Now forks output SARIF to an artifact instead of trying to upload.
Parse SARIF output and exit non-zero if error-level findings exist.
)

* prepare release 2.0.15

* bump snapshot 2.0.16-SNAPSHOT (swagger-api#490)

Co-authored-by: ewaostrowska <ewaostrowska@users.noreply.github.com>

* fix: remove unrecognized aggregate parameter from maven-javadoc-plugin configuration (swagger-api#491)

Co-authored-by: Daniel Kmiecik <daniel.kmiecik@smartbear.com>

* prepare release 2.0.16

* bump snapshot 2.0.17-SNAPSHOT

* chore: update jackson, commons-io, and commons-lang dependencies

* Update gh actions

* Bump ch.qos.logback:logback-core from 1.5.22 to 1.5.25

Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.5.22 to 1.5.25.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](qos-ch/logback@v_1.5.22...v_1.5.25)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-core
  dependency-version: 1.5.25
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update peter-evans/create-pull-request to v8

* prepare release 2.0.17

* bump snapshot 2.0.18-SNAPSHOT

* chore: migrate from tibdex/github-app-token to actions/create-github-app-token

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: ewaostrowska <ewaostrowska@users.noreply.github.com>
Co-authored-by: ewaostrowska <ewa.ostrowska@smartbear.com>
Co-authored-by: sonatypeoss[bot] <68616245+sonatypeoss[bot]@users.noreply.github.com>
Co-authored-by: Mateusz Wroński <mateusz.wronski@smartbear.com>
Co-authored-by: Daniel Kmiecik <daniel.kmiecik@smartbear.com>
Co-authored-by: Damian Jankowski <damian.jankowski@smartbear.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: djankows <177228371+djankows@users.noreply.github.com>
Co-authored-by: ewaostrowska <214632419+ewaostrowska@users.noreply.github.com>
- Add 19 tests covering nullable conversion (all branches), version
  detection, validate(), and getValidationSchema() cache behavior
- Fix validate() to call getValidationSchema() so the schema cache is
  used on the hot path instead of being bypassed
- Expand PR matrix from [8, 11] to [8, 11, 17, 21] to match master
SchemaValidator was refactored to eliminate static openApiVersion state;
tests updated to use parseOpenApiVersion() and the 2-arg validate/getValidationSchema.
…it tests

Remove tests already covered by SchemaValidationTest (validate, cache,
parseOpenApiVersion). Keep only the 9 per-branch unit tests for the
package-private convertNullableForDraft04 method.
@daniel-kmiecik

Copy link
Copy Markdown
Contributor

Hi @xtina , thank you for putting this together. The effort is clearly substantial and many of the changes here are in the right direction.

I wanted to let you know that we have just released a new version of Inflector with built-in Jakarta EE support, and the minimum required Java version has been bumped to 17. So some of the groundwork you laid here is already covered upstream.

That said, I'd like to ask you to split this PR before we can review and consider merging it. Right now it bundles quite a few independent concerns together:

  • Java version enforcement changes
  • OAS 3.1 / JSON Schema Draft 2020-12 validation support
  • CI matrix and workflow fixes
  • SLF4J/Logback version bumps
  • Javadoc additions
  • Classpath deduplication fix
  • Javadoc link cleanup

Each of these is a separate concern that deserves its own focused review. Mixing them into a single PR makes it very hard to evaluate the risk of each change individually, reason about test coverage, and make a clean merge decision. If one part needs rework, it blocks everything else.
Please consider splitting this into smaller, single-purpose PRs.
Thanks again for your work on this!

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.

2 participants