Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

fix: remove requirement for operationId #69

Merged
merged 1 commit into from
Apr 29, 2020

Conversation

Flydiverny
Copy link
Contributor

No description provided.

@Flydiverny
Copy link
Contributor Author

Should hopefully solve external-secrets/kubernetes-external-secrets#278 :)

} : {
pathName: options.pathname,
method: options.method
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to https://github.com/swagger-api/swagger-js#tryitout-executor
pathName and method can be provided in place of operationId

Possibly even preferred in this case?

// If pathName and method, then those are used instead of operationId. This is useful if you're using this dynamically, as pathName + method are guarenteed to be unique.

Keeping old behaviour when possible seemed like a less intrusive change tho :)

@@ -220,7 +220,6 @@ class Component {
// "Expose" operations by omitting the leading _ from the method name.
//
Object.keys(endpoint.pathItem)
.filter(key => endpoint.pathItem[key].operationId)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I'm not really sure why this filter existed in the first place but it seems fine to remove?

@Flydiverny
Copy link
Contributor Author

I suppose alternative solution would be to make sure nothing is generated for paths lacking operationId or do patching in https://github.com/godaddy/kubernetes-client/blob/0f9ec26b381c8603e7727c3346edb35e1db2deb1/lib/swagger-client.js#L80-L107 which expects an item to be callable if it has the methods

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

Successfully merging this pull request may close these issues.

2 participants