fix(http): remove id param for /buckets and update swagger (#1942)

pull/10616/head
Jade McGough 2018-12-13 16:27:34 -08:00 committed by GitHub
parent 4e7f89d6a1
commit 909fb6e98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 46 deletions

View File

@ -390,14 +390,6 @@ func decodeGetBucketsRequest(ctx context.Context, r *http.Request) (*getBucketsR
req.filter.Organization = &org
}
if bucketID := qp.Get("id"); bucketID != "" {
id, err := platform.IDFromString(bucketID)
if err != nil {
return nil, err
}
req.filter.ID = id
}
if name := qp.Get("name"); name != "" {
req.filter.Name = &name
}

View File

@ -2396,8 +2396,17 @@ paths:
parameters:
- in: query
name: org
description: specifies the organization of the resource
required: true
description: specifies the organization name of the resource
schema:
type: string
- in: query
name: orgID
description: specifies the organization id of the resource
schema:
type: string
- in: query
name: name
description: only returns buckets with the specified name
schema:
type: string
responses:

View File

@ -626,42 +626,6 @@ func FindBuckets(
},
},
},
{
name: "find bucket by id",
fields: BucketFields{
Organizations: []*platform.Organization{
{
Name: "theorg",
ID: MustIDBase16(orgOneID),
},
},
Buckets: []*platform.Bucket{
{
ID: MustIDBase16(bucketOneID),
OrganizationID: MustIDBase16(orgOneID),
Name: "abc",
},
{
ID: MustIDBase16(bucketTwoID),
OrganizationID: MustIDBase16(orgOneID),
Name: "xyz",
},
},
},
args: args{
ID: MustIDBase16(bucketTwoID),
},
wants: wants{
buckets: []*platform.Bucket{
{
ID: MustIDBase16(bucketTwoID),
OrganizationID: MustIDBase16(orgOneID),
Organization: "theorg",
Name: "xyz",
},
},
},
},
{
name: "find bucket by name",
fields: BucketFields{