Skip to content

fix: Migrate from getkin/kin-openapi to oasdiff/kin-openapi fork#1187

Open
andmatei wants to merge 2 commits intomainfrom
migrate-to-oasdiff-kin-openapi-fork
Open

fix: Migrate from getkin/kin-openapi to oasdiff/kin-openapi fork#1187
andmatei wants to merge 2 commits intomainfrom
migrate-to-oasdiff-kin-openapi-fork

Conversation

@andmatei
Copy link
Collaborator

@andmatei andmatei commented Mar 18, 2026

Summary

This PR migrates from github.com/getkin/kin-openapi to github.com/oasdiff/kin-openapi (the oasdiff fork). This migration is required to upgrade oasdiff to v1.12.x+.

Background

As of oasdiff v1.12.0 (March 2026), oasdiff permanently switched to using their own fork of kin-openapi (github.com/oasdiff/kin-openapi). This was done to add Source Location Tracking and OpenAPI 3.1 support without waiting for upstream PRs.

The two libraries are incompatible at runtime - attempting to use both causes type mismatches at compile time due to transitive dependencies through oasdiff/yaml.

Changes

Import Path Changes (57 files)

  • Replaced all github.com/getkin/kin-openapi imports with github.com/oasdiff/kin-openapi

go.mod Updates

  • Updated to github.com/oasdiff/oasdiff@v1.12.3
  • Updated to github.com/oasdiff/kin-openapi@v0.136.0
  • Removed direct dependency on github.com/getkin/kin-openapi

API Breaking Changes Fixed

kin-openapi v0.134.0+:

  • Discriminator.Mapping changed from map[string]string to map[string]MappingRef

oasdiff v1.12.x:

  • ParametersDiff, ResponsesDiff, SchemasDiff moved from root Diff struct to Diff.ComponentsDiff
  • OperationsDiff.Added/Deleted changed from utils.StringList to []string
  • StringsDiff.Added/Deleted changed to []string

Testing

  • Build passes
  • Unit tests pass
  • E2E tests pass

Related Issues

References

This migration is required to upgrade oasdiff to v1.12.x+, which switched
to using their own fork of kin-openapi for OpenAPI 3.1 and source location
tracking support.

Changes:
- Replace all github.com/getkin/kin-openapi imports with github.com/oasdiff/kin-openapi
- Update go.mod to use oasdiff/oasdiff@v1.12.3 and oasdiff/kin-openapi@v0.136.0
- Fix breaking API changes:
  - Discriminator.Mapping now uses MappingRef structs instead of strings
  - ParametersDiff, ResponsesDiff, SchemasDiff moved to ComponentsDiff
  - OperationsDiff.Added/Deleted changed from StringList to []string
  - StringsDiff.Added/Deleted changed to []string

Closes blocked dependabot PRs for kin-openapi and oasdiff upgrades.

See: oasdiff/oasdiff#810
@andmatei andmatei changed the title Migrate from getkin/kin-openapi to oasdiff/kin-openapi fork fix: Migrate from getkin/kin-openapi to oasdiff/kin-openapi fork Mar 19, 2026
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM

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