-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add support for OpenAPI v3 #142
Add support for OpenAPI v3 #142
Conversation
47c0fd5
to
d91b2fd
Compare
pkg/cmd/builder.go
Outdated
@@ -243,7 +245,7 @@ func mergeOpenAPIDefinitions(definitionsGetters []openapicommon.GetOpenAPIDefini | |||
} | |||
} | |||
|
|||
func (b *AdapterBase) defaultOpenAPIConfig() *openapicommon.Config { | |||
func (b *AdapterBase) defaultOpenAPIConfig(createConfig func(getDefinitions openapicommon.GetOpenAPIDefinitions, defNamer *openapinamer.DefinitionNamer) *openapicommon.Config) *openapicommon.Config { |
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.
I find it quite confusing to have the function passed as an argument when we would expect the function to not take any and just return whatever the default config is.
what do you think about splitting that into 3 functions:
- openAPIConfig(createConfig func(getDefinitions openapicommon.GetOpenAPIDefinitions, defNamer *openapinamer.DefinitionNamer) *openapicommon.Config)
- defaultOpenAPIConfig()
- defaultOpenAPIV3Config()
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.
Yes, I should definitely have done that!
I've updated the PR.
/triage accepted |
d91b2fd
to
071e8cb
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgrisonnet, olivierlemasle The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Add support for OpenAPI v3
Cf the implementation in sample-apiserver
/kind feature