Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#2718: [kn-plugin-workflow] Minify the openAPI spec files to trim components/schemas #2749

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

treblereel
Copy link
Contributor

issue: #2718

@treblereel
Copy link
Contributor Author

Path declarations may contain $ref references, which in turn may refer to other declarations. Therefore, before removing them, it is necessary to identify all declarations that the desired operationId depends on. A special case is securitySchemes; if they are present in the document, they should be retained since the reference to them occurs implicitly.

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

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

Great work, man!

return nil, fmt.Errorf("❌ ERROR: failed to load OpenAPI document: %w", err)
}
if doc.Paths == nil {
return nil, fmt.Errorf("OpenAPI document %s has no paths", specFileName)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to return an error here? Maybe just log silently to not spur the user's console with an error. If this is handled by the caller, just ignore my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants