Skip to content

Commit

Permalink
[Fleet] fix response schema for cancel upgrade (elastic#205493)
Browse files Browse the repository at this point in the history
Noticed when cancelling an upgrade action that the API gave an error
response saying that `agents` field is expected to be an array, but got
undefined.
Fixing the schema so that `agents` is optional.

Verified by scheduling an upgrade in the future and cancelling from UI.

<img width="2535" alt="image"
src="https://github.com/user-attachments/assets/556ac459-9f46-4a69-aa3a-39e20d9cf55b"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
juliaElastic and kibanamachine authored Jan 3, 2025
1 parent 7d76276 commit e51b581
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
6 changes: 2 additions & 4 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -16520,8 +16520,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}
Expand Down Expand Up @@ -18740,8 +18739,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}
Expand Down
6 changes: 2 additions & 4 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -16520,8 +16520,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}
Expand Down Expand Up @@ -18740,8 +18739,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}
Expand Down
2 changes: 0 additions & 2 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17250,7 +17250,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':
Expand Down Expand Up @@ -17779,7 +17778,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':
Expand Down
2 changes: 0 additions & 2 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19374,7 +19374,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':
Expand Down Expand Up @@ -19896,7 +19895,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const PostNewAgentActionResponseSchema = schema.object({
sent_at: schema.maybe(schema.string()),
created_at: schema.string(),
ack_data: schema.maybe(schema.any()),
agents: schema.arrayOf(schema.string()),
agents: schema.maybe(schema.arrayOf(schema.string())),
namespaces: schema.maybe(schema.arrayOf(schema.string())),
expiration: schema.maybe(schema.string()),
start_time: schema.maybe(schema.string()),
Expand Down

0 comments on commit e51b581

Please sign in to comment.