Skip to content

Commit

Permalink
fix: enum type of session expandables (#3895)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Apr 25, 2024
1 parent ec90929 commit c435727
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
13 changes: 6 additions & 7 deletions session/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,16 @@ type listSessionsRequest struct {
//
// required: false
// in: query
ExpandOptions []ListSessionExpandable `json:"expand"`
ExpandOptions []SessionExpandable `json:"expand"`
}

// Expandable properties of a session
// swagger:enum ListSessionExpandable
type ListSessionExpandable string
// swagger:enum SessionExpandable
type SessionExpandable string

const (
ListSessionExpandableIdentity ListSessionExpandable = "identity"
ListSessionExpandableDevices ListSessionExpandable = "devices"
SessionExpandableIdentity SessionExpandable = "identity"
SessionExpandableDevices SessionExpandable = "devices"
)

// Session List Response
Expand Down Expand Up @@ -440,9 +440,8 @@ type getSession struct {
// If no value is provided, the expandable properties are skipped.
//
// required: false
// enum: identity,devices
// in: query
ExpandOptions []string `json:"expand"`
ExpandOptions []SessionExpandable `json:"expand"`

// ID is the session's ID.
//
Expand Down
8 changes: 4 additions & 4 deletions spec/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -4901,11 +4901,11 @@
"in": "query",
"name": "expand",
"schema": {
"enum": [
"identity",
"devices"
],
"items": {
"enum": [
"identity",
"devices"
],
"type": "string"
},
"type": "array"
Expand Down
12 changes: 6 additions & 6 deletions spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1090,12 +1090,12 @@
"operationId": "getSession",
"parameters": [
{
"enum": [
"identity",
"devices"
],
"type": "array",
"items": {
"enum": [
"identity",
"devices"
],
"type": "string"
},
"description": "ExpandOptions is a query parameter encoded list of all properties that must be expanded in the Session.\nExample - ?expand=Identity\u0026expand=Devices\nIf no value is provided, the expandable properties are skipped.",
Expand Down Expand Up @@ -3251,9 +3251,9 @@
"title": "JSONRawMessage represents a json.RawMessage that works well with JSON, SQL, and Swagger."
},
"NullTime": {
"description": "NullTime implements the Scanner interface so\nit can be used as a scan destination, similar to NullString.",
"description": "NullTime implements the [Scanner] interface so\nit can be used as a scan destination, similar to [NullString].",
"type": "object",
"title": "NullTime represents a time.Time that may be null.",
"title": "NullTime represents a [time.Time] that may be null.",
"properties": {
"Time": {
"type": "string",
Expand Down

0 comments on commit c435727

Please sign in to comment.