Closed tomplus closed 4 years ago
It looks like this behavior is crucial. OperationId is used to build method name and we have the same name in different API versions (beta, alpha etc).
Have you tried removing the replacing step?
It looks like this behavior is crucial. OperationId is used to build method name and we have the same name in different API versions (beta, alpha etc).
Yes, that's what I though it does. Without the replacing step we would have the API versions in the method names, which would be a breaking change and a more verbose UX.
Having the same method name in different API versions worked for us. Is there any reason that openapi-generator enforces unique operationID across all modules?
It's required by the OpenAPI spec: https://swagger.io/specification/#operationObject
It's required by the OpenAPI spec: https://swagger.io/specification/#operationObject
Fair enough. I think keeping the old method names is a better UX and is also backwards compatible. In the meantime, I'm not sure what signals does the openapi-generator spec validation give us. If it adds value on top of the other testing we have (e.g. client e2e tests), we may consider doing things like
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
@fejta-bot: Closing this issue.
The script
preprocess_spec.py
removes "tags" fromoperationId
downloaded from K8s spec:https://github.com/kubernetes-client/gen/blob/09f7470cab46c32e2e3458e6c98161829db88c44/openapi/preprocess_spec.py#L102
and it makes that some operationId's become duplicated but they should be unique.
The latest version of openapi-generator (>4.x) has additional validations which complains about that:
We can disable this validation or fix our script by removing this replacing step - is this replacement necessary?