builder: correct uniqueItems and array types for non-body parameters - #629
builder: correct uniqueItems and array types for non-body parameters#629Lfan-ke wants to merge 1 commit into
Conversation
Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Lfan-ke The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @Lfan-ke! |
buildParametersetUniqueItems = !AllowMultiple()on every non-body parameter. ButuniqueItemsis an array-only validation in JSON Schema / OpenAPI, so:uniqueItems: true, andThis corrects both the v2 (
pkg/builder) and v3 (pkg/builder3) builders to:{type, format}for scalar parameters (nouniqueItems);type: array+items(+collectionFormat: multiin v2).Unit tests cover both the scalar and the multi-value paths; the existing golden expectations are updated to drop the spurious
uniqueItems.Refs kubernetes/kubernetes#140050