fix(story): move productID from request body to query string - #6
Open
rioliu wants to merge 2 commits into
Open
Conversation
ZenTao v2 API requires productID as a URL query parameter for story creation, but the SDK was sending it in the request body, causing 'Missing required parameter: productID' errors. Changes: - generated.ts: Move productID from requestBody schema to params array for the story/create action, so it's sent as a query parameter - resolve.ts: Add productID -> product fallback in buildQuery, matching the existing pageID -> page pattern for backward compatibility Fixes easysoft/zentao-cli#13 Fixes easysoft/zentao-cli#14
…ctplan Apply the same fix as story/create to other modules that require productID as a query parameter: - bug/create: move productID from requestBody to params - epic/create: move productID from requestBody to params - requirement/create: move productID from requestBody to params - productplan/create: move productID from requestBody to params All these modules now work with the ZenTao v2 API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
zentao story createfails with:ZenTao v2 API requires
productIDas a URL query parameter for story creation, but the SDK sends it in the request body.POST /api.php/v2/storiesbody:{"productID":3,...}POST /api.php/v2/stories?productID=3body:{"title":"test",...}Changes
src/modules/generated.tsproductIDfromrequestBody.schema.propertiestoparamsarray for thestory/createactionproductIDfrom therequiredarray in the body schemasrc/modules/resolve.tsproductID→productfallback inbuildQuery(), matching the existingpageID→pagepattern--product=3or--productID=3Testing
Verified locally:
zentao story create --product=3 --title="test" --reviewer=adminworkszentao_storycreate) worksRelated Issues