Skip to content

fix: replace kin-openapi with libopenapi for OpenAPI 3.1 support#2032

Merged
jeremybeard merged 1 commit intomainfrom
fix/openapi-31-libopenapi
Mar 6, 2026
Merged

fix: replace kin-openapi with libopenapi for OpenAPI 3.1 support#2032
jeremybeard merged 1 commit intomainfrom
fix/openapi-31-libopenapi

Conversation

@jeremybeard
Copy link
Contributor

@jeremybeard jeremybeard commented Mar 5, 2026

Summary

  • Replaces kin-openapi with pb33f/libopenapi v0.34.0 to fix OpenAPI 3.1 spec parsing for Airflow 3.1+
  • Airflow 3.1+ uses numeric exclusiveMinimum (OpenAPI 3.1), which kin-openapi v0.131.0 silently fails to parse, resulting in "no endpoints found"
  • Introduces self-contained types in pkg/openapi/types.go so the library dependency is isolated to the parsing layer, making tests simpler and future library swaps trivial

Test plan

  • go build ./... compiles cleanly
  • go test ./pkg/openapi/... ./cmd/api/... all tests pass
  • astro api airflow ls --airflow-version 3.1.7 lists endpoints successfully
  • astro api airflow ls --airflow-version 3.0.3 still works for 3.0.x
  • astro api airflow ls --airflow-version 2.10.0 still works for 2.x
  • astro api airflow describe get_dags --airflow-version 3.1.7 schema details display correctly
  • astro api airflow ls works with live local Airflow instance (auto-detect version)

🤖 Generated with Claude Code

Airflow 3.1+ uses OpenAPI 3.1's numeric exclusiveMinimum which
kin-openapi v0.131.0 cannot parse, causing silent failures and
"no endpoints found" errors. Replace with pb33f/libopenapi v0.34.0
which fully supports OpenAPI 3.0, 3.1, and 3.2.

Introduces self-contained types in pkg/openapi/types.go so the
library dependency is isolated to the parsing layer, making tests
simpler and future library swaps trivial.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremybeard jeremybeard marked this pull request as ready for review March 5, 2026 22:50
@jeremybeard jeremybeard requested a review from a team as a code owner March 5, 2026 22:50
@coveralls-official
Copy link

Pull Request Test Coverage Report for Build 39cf7016-9a3f-4837-b18b-8531b648428f

Details

  • 177 of 233 (75.97%) changed or added relevant lines in 5 files are covered.
  • 209 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.02%) to 35.969%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/openapi/cache.go 22 26 84.62%
pkg/openapi/types.go 0 5 0.0%
pkg/openapi/endpoints.go 106 153 69.28%
Files with Coverage Reduction New Missed Lines %
pkg/openapi/endpoints.go 2 78.54%
airflow/proxy/daemon.go 30 31.09%
airflow/proxy/routes.go 43 68.15%
airflow/standalone.go 134 77.12%
Totals Coverage Status
Change from base Build f1bde921-c537-4ca3-adea-63e49196f02b: 0.02%
Covered Lines: 24372
Relevant Lines: 67759

💛 - Coveralls

github.com/fsnotify/fsevents v0.2.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/getkin/kin-openapi v0.131.0 // indirect
Copy link
Member

Choose a reason for hiding this comment

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

Why does kin still get pulled in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"indirect" means it's a transitive dependency of something else. It was already there before I added the feature, this is why I used it in the first place, turns out it wasn't the best choice!

@jeremybeard jeremybeard merged commit d53867d into main Mar 6, 2026
6 of 7 checks passed
@jeremybeard jeremybeard deleted the fix/openapi-31-libopenapi branch March 6, 2026 14:05
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