Skip to content

Commit

Permalink
add comment on string for POST validation
Browse files Browse the repository at this point in the history
  • Loading branch information
lmd59 committed Oct 4, 2024
1 parent 9c2462e commit 5e69f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/src/requestSchemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export const ApproveArgs = z
artifactAssessmentRelatedArtifact: checkUri.optional(),
artifactAssessmentAuthor: z
.union([z.object({ reference: z.string() }).transform(val => val.reference), z.string()])
.optional() //object from POST or string from GET
.optional() //object from POST or string from GET (this may be overly permissive of string in POST parameters)
})
.strict()
.superRefine(catchInvalidParams([catchMissingId, catchMissingTypeAndSummary]));
Expand All @@ -224,7 +224,7 @@ export const ReviewArgs = z
artifactAssessmentRelatedArtifact: checkUri.optional(),
artifactAssessmentAuthor: z
.union([z.object({ reference: z.string() }).transform(val => val.reference), z.string()])
.optional() //object from POST or string from GET
.optional() //object from POST or string from GET (this may be overly permissive of string in POST parameters)
})
.strict()
.superRefine(catchInvalidParams([catchMissingId, catchMissingTypeAndSummary]));
Expand Down

0 comments on commit 5e69f96

Please sign in to comment.