Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/http/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const (
MetadataKey = "metadata"
NameKey = "name"
TagKey = "tag"
TagsKey = "tags"
StatusKey = "status"

ClientKey = "client"
Expand Down
11 changes: 4 additions & 7 deletions apidocs/openapi/channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ paths:
- $ref: "#/components/parameters/Offset"
- $ref: "#/components/parameters/Order"
- $ref: "#/components/parameters/Direction"
- $ref: "#/components/parameters/Tags"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Status"
- $ref: "#/components/parameters/ChannelName"
Expand Down Expand Up @@ -776,16 +777,12 @@ components:

Tags:
name: tags
description: Client tags.
description: Channel tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
in: query
schema:
type: array
minItems: 0
uniqueItems: true
items:
type: string
type: string
required: false
example: ["yello", "orange"]
example: "orange,yellow"

ChannelName:
name: name
Expand Down
10 changes: 3 additions & 7 deletions apidocs/openapi/clients.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1265,16 +1265,12 @@ components:

Tags:
name: tags
description: Client tags.
description: Clients tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
in: query
schema:
type: array
minItems: 0
uniqueItems: true
items:
type: string
type: string
required: false
example: ["yello", "orange"]
example: "orange,yellow"

Metadata:
name: metadata
Expand Down
9 changes: 9 additions & 0 deletions apidocs/openapi/domains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ paths:
- $ref: "#/components/parameters/Order"
- $ref: "#/components/parameters/Direction"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/Tags"
- $ref: "#/components/parameters/Status"
- $ref: "#/components/parameters/DomainName"
- $ref: "./schemas/roles.yaml#/components/parameters/ActionsQuery"
Expand Down Expand Up @@ -1179,6 +1180,14 @@ components:
schema:
type: object
additionalProperties: {}
Tags:
name: tags
description: Domain tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
in: query
schema:
type: string
required: false
example: "orange,yellow"
Type:
name: type
description: The type of the API Key.
Expand Down
11 changes: 4 additions & 7 deletions apidocs/openapi/groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ paths:
- $ref: "#/components/parameters/DirectionOrder"
- $ref: "#/components/parameters/Level"
- $ref: "#/components/parameters/Tree"
- $ref: "#/components/parameters/Tags"
- $ref: "#/components/parameters/Metadata"
- $ref: "#/components/parameters/GroupName"
- $ref: "#/components/parameters/RootGroup"
Expand Down Expand Up @@ -1377,16 +1378,12 @@ components:

Tags:
name: tags
description: User tags.
description: Group tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
in: query
schema:
type: array
minItems: 0
uniqueItems: true
items:
type: string
type: string
required: false
example: ["yello", "orange"]
example: "orange,yellow"

GroupName:
name: name
Expand Down
10 changes: 5 additions & 5 deletions apidocs/openapi/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ paths:
- $ref: "#/components/parameters/LastName"
- $ref: "#/components/parameters/Username"
- $ref: "#/components/parameters/Email"
- $ref: "#/components/parameters/Tag"
- $ref: "#/components/parameters/Tags"
- $ref: "#/components/parameters/OnlyTotal"
security:
- bearerAuth: []
Expand Down Expand Up @@ -1138,14 +1138,14 @@ components:
required: false
example: enabled

Tag:
name: tag
description: User tag.
Tags:
name: tags
description: User tags. Multiple tags can be specified separated by comma for OR condition and hyphen for AND condition.
in: query
schema:
type: string
required: false
example: "orange"
example: "orange,yellow"

GroupName:
name: name
Expand Down
8 changes: 6 additions & 2 deletions channels/api/http/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ func decodeListChannels(_ context.Context, r *http.Request) (any, error) {
return listChannelsReq{}, errors.Wrap(apiutil.ErrValidation, err)
}

tag, err := apiutil.ReadStringQuery(r, api.TagKey, "")
tags, err := apiutil.ReadStringQuery(r, api.TagsKey, "")
if err != nil {
return nil, errors.Wrap(apiutil.ErrValidation, err)
}
var tq channels.TagsQuery
if tags != "" {
tq = channels.ToTagsQuery(tags)
}

s, err := apiutil.ReadStringQuery(r, api.StatusKey, api.DefGroupStatus)
if err != nil {
Expand Down Expand Up @@ -157,7 +161,7 @@ func decodeListChannels(_ context.Context, r *http.Request) (any, error) {
req := listChannelsReq{
Page: channels.Page{
Name: name,
Tag: tag,
Tags: tq,
Status: status,
Metadata: meta,
RoleName: roleName,
Expand Down
Loading
Loading