Skip to content

Commit

Permalink
fix(http): remove id param for /buckets and update swagger (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
imogenkinsman authored Dec 14, 2018
1 parent 4e7f89d commit 909fb6e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 46 deletions.
8 changes: 0 additions & 8 deletions http/bucket_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
13 changes: 11 additions & 2 deletions http/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 0 additions & 36 deletions testing/bucket_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 909fb6e

Please sign in to comment.