Skip to content

Reduce excessive URI encoding [V2]#2750

Draft
gejohnston wants to merge 22 commits into
zowe-v2-ltsfrom
encode-uri-v2
Draft

Reduce excessive URI encoding [V2]#2750
gejohnston wants to merge 22 commits into
zowe-v2-ltsfrom
encode-uri-v2

Conversation

@gejohnston

@gejohnston gejohnston commented Jun 17, 2026

Copy link
Copy Markdown
Member

What It Does

To prepare for future changes to URI encoding, this PR reduces the encoding used for URIs in REST requests by the following Zowe client SDK operations. These operations cover all known REST URIs that are currently encoded by Zowe clients.

  • For datasets and uss files:
    • copy
    • create
    • delete
    • download
    • list
    • rename
    • upload
  • For only datasets
    • mount
    • unmount
  • For jobs
    • cancelJobs
    • deleteJobs
    • downloadJobs
    • getJobs
    • modifyJobs

URI encoding has been reduced to the minimum that still allows the operations to work successfully in the current z/OS environment.

URI encoding has been consolidated into one file (EncodeUri.ts) to enable quick adjustment when new URI restrictions come online.

Different levels of URI encoding is implemented for z/OSMF and API-ML, because API-ML requires more characters to be encoded.

Two characters " and \ are valid characters in USS file names. During testing I discovered that both z/OSMF and API-ML fail with vague server errors (like HTTP 500). As part of this change, the Zowe client SDK throws an error when either character is included in a USS file name. That error message identifies the offending character which cannot be used with REST APIs in the current environment.

These changes have been successfully tested manually and successfully regression-tested by automated pipelines in the CLI. Manual testing of Zowe Explorer with these SDK changes is just beginning, and no CHANGELOG has been written yet.

I requested reviews prior to the completion of Zowe Explorer testing to give people sufficient time to review the changes before the upcoming Zowe V2 release. I will keep this PR as a draft until Zowe Explorer testing is complete.

How to Test

Select a valid special character. Place that character into dataset, USS file name, or job. Perform a Zowe CLI command on such an item. USS file names allow more special characters, so they are a good choice for testing. For example, ? is a valid character in a USS file name, but it has special meaning in a URI as the start of a query parameter.

> zowe-v2 files create uss-file '/your/chosen/dir/test?XXX.txt'
USS file or directory created successfully.

> zowe-v2 files list uss-files '/your/chosen/dir/test?XXX.txt'
name                          mode       size uid user
/your/chosen/dir/test?XXX.txt -rwxr-xr-x      14  YOURID

You can also perform any of the other operations listed above with special characters.

Review Checklist
I certify that I have:

  • updated the changelog
  • manually tested my changes
  • added/updated automated unit/integration tests
  • created/ran system tests (provide build number if applicable)
  • followed the contribution guidelines

Additional Comments

The same set of changes will be applied to V3 after the testing of V2 is complete.

gejohnston added 22 commits June 2, 2026 19:04
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
…coding

Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Signed-off-by: Gene Johnston <eugene.johnston@broadcom.com>
Signed-off-by: Gene Johnston <Eugene.Johnston@broadcom.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants