[Fleet] fix response schema for cancel upgrade (#205493)

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>
This commit is contained in:
Julia Bardi 2025-01-03 17:34:00 +01:00 committed by GitHub
parent 7d76276d8b
commit e51b581e25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 13 deletions

View file

@ -16520,8 +16520,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}
@ -18740,8 +18739,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}

View file

@ -16520,8 +16520,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}
@ -18740,8 +18739,7 @@
"type",
"data",
"created_at",
"ack_data",
"agents"
"ack_data"
],
"type": "object"
}

View file

@ -17250,7 +17250,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':
@ -17779,7 +17778,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':

View file

@ -19374,7 +19374,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':
@ -19896,7 +19895,6 @@ paths:
- data
- created_at
- ack_data
- agents
required:
- item
'400':

View file

@ -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()),