Skip to content

Bump kin-openapi and make changes to OpenAPI validation - #1764

Merged
EnriqueL8 merged 3 commits into
hyperledger-firefly:mainfrom
dan-r:main
Jul 27, 2026
Merged

Bump kin-openapi and make changes to OpenAPI validation#1764
EnriqueL8 merged 3 commits into
hyperledger-firefly:mainfrom
dan-r:main

Conversation

@dan-r

@dan-r dan-r commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Bumps kin-openapi to fix a CVE. This new version enforces a stricter OpenAPI 3 spec check than before: two path templates with the same shape can't use different parameter names. This causes validation to fail on two pre-existing routes - PUT /apis/{id} vs GET/DELETE /apis/{apiName}, and GET /identities/{iid} vs GET /identities/{did}. Changes have been made to OpenAPI validation to allow this.

dan-r added 2 commits July 27, 2026 11:05
Signed-off-by: Daniel Raper <daniel.raper@kaleido.io>
Signed-off-by: Daniel Raper <daniel.raper@kaleido.io>
@dan-r
dan-r requested a review from a team as a code owner July 27, 2026 10:35
@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EnriqueL8 EnriqueL8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Dan, important thing to address

// is still uniquely dispatched by its HTTP method. Any other validation
// finding still fails as normal.
func validateOpenAPIDoc(doc *openapi3.T) error {
err := doc.Validate(context.Background(), openapi3.EnableMultiError())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Multi Error allows the validate to return all errors individually


var remaining openapi3.MultiError
for _, e := range multi {
var conflictErr *openapi3.ConflictingPathsError

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we want to ignore all of these for the future, if we introduce new APIs we want to not use Conflicting Paths. So we should ignore this error for existing APIs where we cannot break consumers

Signed-off-by: Daniel Raper <daniel.raper@kaleido.io>

@EnriqueL8 EnriqueL8 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @dan-r

@EnriqueL8
EnriqueL8 merged commit efc27aa into hyperledger-firefly:main Jul 27, 2026
19 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.

2 participants