BrAPI: fix PUT /trials response returning trialName in trialDescription#6121
Open
shbrainard wants to merge 1 commit into
Open
BrAPI: fix PUT /trials response returning trialName in trialDescription#6121shbrainard wants to merge 1 commit into
shbrainard wants to merge 1 commit into
Conversation
The update handler used $folder->name to populate trialDescription in the response, with a comment that description was not accessible from the Folder object. The database write at line 322 was correct; only the response payload was wrong. Read the description from the project row instead.
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.
Summary
lib/CXGN/BrAPI/v2/Trials.pm. The PUT response was returning$folder->namein thetrialDescriptionfield of the response payload, with a comment "description doesn't exist".$folder->description($description || '')at line 322) was correct, so persistence has always been fine. Only the response payload was wrong.trialDescriptionwith the trial name.Reproducer
POST /brapi/v2/trialsto create a trial.PUT /brapi/v2/trials/{id}with the existing body and a modifiedtrialDescription.trialDescriptionfield contains the trial's name, not the value sent.Verification
Reproduced and verified the fix on the breedbase_dockerfile dev stack at
sgn-454.0: PUT round-trip now returns the correcttrialDescription; subsequent GET confirms the database value matches.