-
Notifications
You must be signed in to change notification settings - Fork 193
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
Conversation
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. |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, the file is minimized:
✅ Minified file /home/dhanak/Downloads/subflows/specs/greetingAPI.min.yaml created with 514 bytes (original size: 6248 bytes)
Components and schemas are trimmed as expected.
That was broken with merge of apache#2749
issue: #2718