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

Invalid URL Generation Due to Invalid Character in Path #3890

Open
leonardo-zup opened this issue Jan 31, 2025 · 5 comments
Open

Invalid URL Generation Due to Invalid Character in Path #3890

leonardo-zup opened this issue Jan 31, 2025 · 5 comments

Comments

@leonardo-zup
Copy link

Describe the bug

The line 3304 of the file kubernetes/src/main/java/io/kubernetes/client/openapi/apis/CustomObjectsApi.java:

3304 │ ········String localVarPath = "/apis/{group}/{version}/{plural}#\u{200e}"

is causing the generation of an invalid URL. The inclusion of #\u{200e} at the end of the URL path results in an invalid or improperly formatted URL.

Client Version
22.0.0

Kubernetes Version
Not applicable – the Kubernetes version does not affect this issue.

Java Version
Not applicable – the Java version does not affect this issue.

To Reproduce

  • Call the listCustomObjectForAllNamespacesCall method with a labelSelector parameter.
  • Observe that the labelSelector parameter is not included in the generated URL due to the invalid character #\u{200e}.

Expected behavior
The URL should correctly include all relevant parameters, such as labelSelector.

KubeConfig
Not applicable.

Server (please complete the following information):
Not applicable – the Server does not affect this issue.

@brendandburns
Copy link
Contributor

I don't see this in the code at release-22

https://github.com/kubernetes-client/java/blob/release-22/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/CustomObjectsApi.java

Do you have a link to the commit where you see this code?

Either way, this comes out of the open API spec so if there is a bug, it needs to be corrected in that spec.

Given that HEAD looks ok:
https://github.com/kubernetes-client/java/blob/master/kubernetes/src/main/java/io/kubernetes/client/openapi/apis/CustomObjectsApi.java#L3304

I don't think that there is any action needed here, but let me know if there is more to do.

@leonardo-zup
Copy link
Author

On the screenshot you can see the #

Image

The hidden char you can only see downloading the code and using bat -A CustomObjectsApi.java or something similar

@leonardo-zup
Copy link
Author

Image

@yue9944882
Copy link
Member

https://github.com/kubernetes-client/gen/blame/master/openapi/custom_objects_spec.json#L47

This was introduce from the swagger model here ^ so it will impact all language clients we have. Will send a PR to fix the model first..

@brendandburns
Copy link
Contributor

Thanks @yue9944882. Yeah we'll need to fix that spec file first and then regenerate the code.

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

No branches or pull requests

3 participants