Skip to content

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

Draft
andmatei wants to merge 1 commit intomainfrom
migrate-to-oasdiff-kin-openapi-fork
Draft

Migrate from getkin/kin-openapi to oasdiff/kin-openapi fork#1187
andmatei wants to merge 1 commit intomainfrom
migrate-to-oasdiff-kin-openapi-fork

Conversation

@andmatei
Copy link
Collaborator

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


Pull Request opened by Augment Code with guidance from the PR author

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
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.

1 participant