Skip to content

refactor: drop commons-io dependency - #5328

Merged
daniel-kmiecik merged 1 commit into
swagger-api:3.0.0from
vpelikh:Remove-commons-io-dependency
Sep 23, 2026
Merged

daniel-kmiecik merged 1 commit into
swagger-api:3.0.0from
vpelikh:Remove-commons-io-dependency

Conversation

@vpelikh

@vpelikh vpelikh commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Thank you for contributing to swagger-core!

Please fill out the following information to help us review your PR efficiently.


Description

This PR removes the commons-io dependency from swagger-core and replaces its usages with standard JDK APIs and small in-house utilities. It eliminates an unnecessary dependency, reducing the dependency footprint and supply-chain surface for all consumers of swagger-core.

The change is a refactor and preserves existing behavior. Replaced classes include FileUtils and IOUtils utilities.

Fixes:

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

Screenshots / Additional Context

  • Removed commons-io from pom.xml (dependency declaration and any allowed external dependency lists).
  • Replaced usages of org.apache.commons.io with JDK 17 equivalents.
  • Verified behavior equivalence against commons-io:2.18.0 for null, empty, and typical I/O cases.
  • This is part of an ongoing effort to minimize third-party dependencies (see also refactor: drop commons-lang3 dependency #5323).

Signed-off-by: Vasily Pelikh <vasily.pelikh@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Removes the commons-io dependency and replaces its test utilities with standard JDK APIs.

Changes:

  • Removed Maven and Gradle dependency declarations.
  • Replaced file and stream utilities with Java NIO and standard APIs.
  • Improved case-insensitive output-format checks.
File Description
pom.xml Removes dependency management entries.
modules/​swagger-rest/​src/​test/​java/​io/​swagger/​v3/​jaxrs2/​annotations/​AbstractAnnotationTest.java Replaces resource reading.
modules/​swagger-rest/​pom.xml Removes the test dependency.
modules/​swagger-maven-plugin/​src/​test/​java/​io/​swagger/​v3/​plugin/​maven/​ASwaggerMavenIntegrationTest.java Replaces file reading and format checks.
modules/​swagger-gradle-plugin/​build.gradle Removes the test dependency.
modules/​swagger-core/​src/​test/​java/​io/​swagger/​v3/​core/​util/​TestUtils.java Replaces stream reading.
modules/​swagger-core/​src/​test/​java/​io/​swagger/​v3/​core/​util/​ResourceUtils.java Replaces resource reading.
modules/​swagger-core/​src/​test/​java/​io/​swagger/​v3/​core/​deserialization/​JsonDeserializationTest.java Replaces file reading.
modules/​swagger-core/​pom.xml Removes the test dependency.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@daniel-kmiecik
daniel-kmiecik merged commit 40ae616 into swagger-api:3.0.0 Sep 23, 2026
6 checks passed
@vpelikh
vpelikh deleted the Remove-commons-io-dependency branch September 23, 2026 08:36
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.

3 participants