Skip to content

Commit

Permalink
Merge pull request openflagr#6 from kenli-rubrik/master
Browse files Browse the repository at this point in the history
Make query batch use post with body instead of array query params
  • Loading branch information
diwu1989 authored Jun 22, 2018
2 parents 026f52d + ad82c0e commit 9204096
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 117 deletions.
18 changes: 10 additions & 8 deletions docs/api_docs/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -733,19 +733,21 @@ paths:
schema:
$ref: '#/definitions/error'
/query/batch:
get:
post:
tags:
- query
operationId: getFlagByNameBatch
parameters:
- in: query
name: flagNames
- in: body
name: body
required: true
type: array
items:
type: string
minLength: 1
minItems: 1
description: query batch request
schema:
type: array
items:
type: string
minLength: 1
minItems: 1
responses:
'200':
description: >-
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (qAPI *queryAPI) GetFlagByName(params query.GetFlagByNameParams) middleware
}

func (qAPI *queryAPI) GetFlagByNameBatch(params query.GetFlagByNameBatchParams) middleware.Responder {
flagNames := params.FlagNames
flagNames := params.Body

fs := []entity.Flag{}
q := entity.NewFlagQuerySet(getDB())
Expand Down
18 changes: 10 additions & 8 deletions swagger/query_batch.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
get:
post:
tags:
- query
operationId: getFlagByNameBatch
parameters:
- in: query
name: flagNames
- in: body
name: body
required: true
type: array
items:
type: string
minLength: 1
minItems: 1
description: query batch request
schema:
type: array
items:
type: string
minLength: 1
minItems: 1
responses:
200:
description: returns list of flags with the given names. Omits flags who's names weren't found.
Expand Down
46 changes: 26 additions & 20 deletions swagger_gen/restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions swagger_gen/restapi/operations/flagr_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9204096

Please sign in to comment.