Skip to content

Replace kin-openapi with pb33f/libopenapi for OpenAPI parsing#2299

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/replacing-kin-openapi-with-alternative-l-02c2dda9
Apr 1, 2026
Merged

Replace kin-openapi with pb33f/libopenapi for OpenAPI parsing#2299
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/replacing-kin-openapi-with-alternative-l-02c2dda9

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Mar 31, 2026

Summary

Replace github.com/getkin/kin-openapi with github.com/pb33f/libopenapi (Apache 2.0).

kin-openapi versions above v0.132.0 lack a valid license, making it a dead-end dependency. libopenapi provides full OpenAPI 3.0/3.1 support and is actively maintained.

Changes

  • pkg/tools/builtin/openapi.go — Rewrite OpenAPI parsing to use libopenapi's high-level V3 data model (Document, PathItem, Operation, SchemaProxy, etc.). Add yamlNodeToValue() helper to preserve native types (int, float, bool) for enum and default values.
  • pkg/tools/builtin/openapi_test.go — Add TestOpenAPITool_EnumAndDefaultTypes to verify type preservation for enum and default schema values.
  • go.mod/go.sum — Remove kin-openapi and its transitive deps, add libopenapi.
  • .agents/skills/bump-go-dependencies/SKILL.md — Remove the "never bump kin-openapi" warning.

Security

External reference resolution remains disabled by default (libopenapi sets AllowFileReferences=false and AllowRemoteReferences=false), matching the previous kin-openapi behavior.

@dgageot dgageot requested a review from a team as a code owner March 31, 2026 15:13
gtardif
gtardif previously approved these changes Apr 1, 2026
aheritier
aheritier previously approved these changes Apr 1, 2026
kin-openapi versions above v0.132.0 lack a valid license, making it a
dead-end dependency. Replace it with pb33f/libopenapi (Apache 2.0),
which provides full OpenAPI 3.0/3.1 support and is actively maintained.

Key changes:
- Rewrite pkg/tools/builtin/openapi.go to use libopenapi's high-level
  V3 data model (Document, PathItem, Operation, SchemaProxy, etc.)
- Remove kin-openapi and its transitive dependencies from go.mod
- Remove the "never bump kin-openapi" warning from the
  bump-go-dependencies skill since the dependency no longer exists

Assisted-By: docker-agent
@dgageot dgageot dismissed stale reviews from aheritier and gtardif via 013ba5b April 1, 2026 07:35
@dgageot dgageot force-pushed the board/replacing-kin-openapi-with-alternative-l-02c2dda9 branch from 0580a25 to 013ba5b Compare April 1, 2026 07:35
@dgageot dgageot merged commit 4e0861d into docker:main Apr 1, 2026
4 checks passed
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