Skip to content

Commit

Permalink
[Fleet] fix schema validation to allow undefined/null (elastic#202732)
Browse files Browse the repository at this point in the history
## Summary

Fix a few issues encountered with schema validation.

One of them reported here:
https://discuss.elastic.co/t/fleet-error-updating-policy-settings/371332

The other encountered locally when testing upgrades:
```
"Failed output validation: [request body.items.0.upgrade_details]: expected a plain object value, but found [null] instead."
```

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
2 people authored and hop-dev committed Dec 5, 2024
1 parent 74e5f48 commit 4aa464b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 98 deletions.
27 changes: 3 additions & 24 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -6547,9 +6547,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -7316,9 +7313,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -7577,9 +7571,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -8376,9 +8367,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -9436,9 +9424,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -10204,9 +10189,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -10465,9 +10447,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -11265,9 +11244,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -13278,6 +13254,7 @@
},
"upgrade_details": {
"additionalProperties": false,
"nullable": true,
"properties": {
"action_id": {
"type": "string"
Expand Down Expand Up @@ -15470,6 +15447,7 @@
},
"upgrade_details": {
"additionalProperties": false,
"nullable": true,
"properties": {
"action_id": {
"type": "string"
Expand Down Expand Up @@ -15958,6 +15936,7 @@
},
"upgrade_details": {
"additionalProperties": false,
"nullable": true,
"properties": {
"action_id": {
"type": "string"
Expand Down
27 changes: 3 additions & 24 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -6547,9 +6547,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -7316,9 +7313,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -7577,9 +7571,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -8376,9 +8367,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -9436,9 +9424,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -10204,9 +10189,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -10465,9 +10447,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -11265,9 +11244,6 @@
"type": "number"
}
},
"required": [
"enabled"
],
"type": "object"
},
"monitoring_output_id": {
Expand Down Expand Up @@ -13278,6 +13254,7 @@
},
"upgrade_details": {
"additionalProperties": false,
"nullable": true,
"properties": {
"action_id": {
"type": "string"
Expand Down Expand Up @@ -15470,6 +15447,7 @@
},
"upgrade_details": {
"additionalProperties": false,
"nullable": true,
"properties": {
"action_id": {
"type": "string"
Expand Down Expand Up @@ -15958,6 +15936,7 @@
},
"upgrade_details": {
"additionalProperties": false,
"nullable": true,
"properties": {
"action_id": {
"type": "string"
Expand Down
19 changes: 3 additions & 16 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9628,8 +9628,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -10160,8 +10158,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -10342,8 +10338,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -10896,8 +10890,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -11430,8 +11422,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -11961,8 +11951,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -12143,8 +12131,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -12697,8 +12683,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -14248,6 +14232,7 @@ paths:
type: array
upgrade_details:
additionalProperties: false
nullable: true
type: object
properties:
action_id:
Expand Down Expand Up @@ -14715,6 +14700,7 @@ paths:
type: array
upgrade_details:
additionalProperties: false
nullable: true
type: object
properties:
action_id:
Expand Down Expand Up @@ -15059,6 +15045,7 @@ paths:
type: array
upgrade_details:
additionalProperties: false
nullable: true
type: object
properties:
action_id:
Expand Down
19 changes: 3 additions & 16 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12489,8 +12489,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -13020,8 +13018,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -13202,8 +13198,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -13755,8 +13749,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -14288,8 +14280,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -14818,8 +14808,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -15000,8 +14988,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -15553,8 +15539,6 @@ paths:
maximum: 65353
minimum: 0
type: number
required:
- enabled
monitoring_output_id:
nullable: true
type: string
Expand Down Expand Up @@ -17096,6 +17080,7 @@ paths:
type: array
upgrade_details:
additionalProperties: false
nullable: true
type: object
properties:
action_id:
Expand Down Expand Up @@ -17560,6 +17545,7 @@ paths:
type: array
upgrade_details:
additionalProperties: false
nullable: true
type: object
properties:
action_id:
Expand Down Expand Up @@ -17903,6 +17889,7 @@ paths:
type: array
upgrade_details:
additionalProperties: false
nullable: true
type: object
properties:
action_id:
Expand Down
Loading

0 comments on commit 4aa464b

Please sign in to comment.