Skip to content

Commit

Permalink
Make response spec match actual/TS type
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Jul 21, 2021
1 parent f2014cd commit 5d1216e
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 119 deletions.
79 changes: 30 additions & 49 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,21 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/bulk_upgrade_agents"
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
},
"required": [
"success"
]
}
}
}
}
Expand Down Expand Up @@ -1849,64 +1863,31 @@
},
"bulk_upgrade_agents": {
"title": "Bulk upgrade agents",
"oneOf": [
{
"type": "object",
"properties": {
"version": {
"type": "string"
},
"agents": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"version",
"agents"
]
"type": "object",
"properties": {
"version": {
"type": "string"
},
{
"type": "object",
"properties": {
"version": {
"type": "string"
},
"source_uri": {
"type": "string"
},
"agents": {
"source_uri": {
"type": "string"
},
"agents": {
"oneOf": [
{
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"version",
"agents"
]
},
{
"type": "object",
"properties": {
"version": {
"type": "string"
},
"source_uri": {
"type": "string"
},
"agents": {
{
"type": "string"
}
},
"required": [
"version",
"agents"
]
}
},
"required": [
"agents",
"version"
]
},
"upgrade_agent": {
Expand Down
58 changes: 23 additions & 35 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,16 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/bulk_upgrade_agents'
type: object
additionalProperties:
type: object
properties:
success:
type: boolean
error:
type: string
required:
- success
'400':
description: BAD REQUEST
content:
Expand Down Expand Up @@ -1176,42 +1185,21 @@ components:
- status
bulk_upgrade_agents:
title: Bulk upgrade agents
oneOf:
- type: object
properties:
version:
type: string
agents:
type: array
items:
type: string
required:
- version
- agents
- type: object
properties:
version:
type: string
source_uri:
type: string
agents:
type: array
type: object
properties:
version:
type: string
source_uri:
type: string
agents:
oneOf:
- type: array
items:
type: string
required:
- version
- agents
- type: object
properties:
version:
type: string
source_uri:
type: string
agents:
type: string
required:
- version
- agents
- type: string
required:
- agents
- version
upgrade_agent:
title: Upgrade agent
oneOf:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
title: Bulk upgrade agents
oneOf:
- type: object
properties:
version:
type: string
agents:
type: array
type: object
properties:
version:
type: string
source_uri:
type: string
agents:
oneOf:
- type: array
items:
type: string
required:
- version
- agents
- type: object
properties:
version:
type: string
source_uri:
type: string
agents:
type: array
items:
type: string
required:
- version
- agents
- type: object
properties:
version:
type: string
source_uri:
type: string
agents:
type: string
required:
- version
- agents
- type: string
required:
- agents
- version
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ post:
content:
application/json:
schema:
$ref: ../components/schemas/bulk_upgrade_agents.yaml
type: object
additionalProperties:
type: object
properties:
success:
type: boolean
error:
type: string
required:
- success
'400':
description: BAD REQUEST
content:
Expand Down

0 comments on commit 5d1216e

Please sign in to comment.