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

fix for header's Content-Type:"strategic merge patch" for patch operation's. #133

Closed
wants to merge 1 commit into from

Conversation

karthikkondapally
Copy link
Contributor

fix for issue #127
tried to handle it according to doc https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#patch-operations and also based on similar fix in python client (kubernetes-client/python#187)
but i believe this is not complete fix, as Content-Type: application/merge-patch+json is never set for merge operation of JSONs.
is it possible to explicitly tell whether it is application/merge-patch+json just for patch calls?

@karthikkondapally karthikkondapally changed the title fix for header's Content-Type:strategic merge patch. issue https://github.com/kubernetes-client/java/issues/127 fix for header's Content-Type:"strategic merge patch" for patch operation's. Nov 29, 2017
@brendandburns
Copy link
Contributor

@mbohlool I think that maybe this should be fixed in the OpenAPI/Code Generation?

@karthikkondapally
Copy link
Contributor Author

closing the pull request as this has to be fixed else where (OpenAPI/Code Generation)

@mbohlool
Copy link
Contributor

I am not sure about a fix in OpenAPI or code generations. This is a special case we handle it similarly in python client (by checking the type of provided object and change the content-type accordingly). If you guys have a suggestion on how to fix this in code generation, I would like to discuss it, otherwise we should check in something similar to this PR.

@karthikkondapally
Copy link
Contributor Author

In OpenAPI 2.0, filter/selection based on content type in request header is not present (link to issue raised in open api git) may be another usecase but issue also.
But in OpenAPI 3.0 this feature/support has been added (link to requestbody).

but swagger(3.0.0.0) which supports OpenAPI 3.0 is still in development phase.

one blunt solution to generate individual functions with correct content type is by splitting the paths of rest end point. some thing like /strategicMergePatchDeploymentWithList, /patchDeployment and /mergePatchDeployment in specification.

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

Successfully merging this pull request may close these issues.

3 participants