diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 45e1ffd83b3ae..3105758bae5a3 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -23292,9 +23292,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -23321,9 +23321,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -23478,9 +23478,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -24368,9 +24368,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -24397,9 +24397,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -24554,9 +24554,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -25226,9 +25226,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -25255,9 +25255,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -25412,9 +25412,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -26063,9 +26063,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -26092,9 +26092,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -26249,9 +26249,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27138,9 +27138,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27167,9 +27167,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27324,9 +27324,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -28088,9 +28088,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -28117,9 +28117,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -28274,9 +28274,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -29862,9 +29862,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -29891,9 +29891,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -29977,9 +29977,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -30420,9 +30420,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -30449,9 +30449,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -30606,9 +30606,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -46886,9 +46886,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -46915,9 +46915,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -47072,9 +47072,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -47560,9 +47560,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -47589,9 +47589,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -47692,9 +47692,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -47996,9 +47996,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -48025,9 +48025,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -48182,9 +48182,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -48591,9 +48591,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -48620,9 +48620,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -48777,9 +48777,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49235,9 +49235,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49264,9 +49264,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49421,9 +49421,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49910,9 +49910,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49939,9 +49939,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50042,9 +50042,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50345,9 +50345,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50374,9 +50374,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50531,9 +50531,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51284,9 +51284,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51313,9 +51313,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51470,9 +51470,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index f1b9721fded3f..6f8e086e690c7 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -25869,9 +25869,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -25898,9 +25898,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -26055,9 +26055,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -26945,9 +26945,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -26974,9 +26974,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27131,9 +27131,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27803,9 +27803,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27832,9 +27832,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -27989,9 +27989,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -28640,9 +28640,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -28669,9 +28669,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -28826,9 +28826,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -29715,9 +29715,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -29744,9 +29744,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -29901,9 +29901,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -30665,9 +30665,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -30694,9 +30694,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -30851,9 +30851,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -32439,9 +32439,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -32468,9 +32468,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -32554,9 +32554,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -32997,9 +32997,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -33026,9 +33026,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -33183,9 +33183,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49463,9 +49463,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49492,9 +49492,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -49649,9 +49649,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50137,9 +50137,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50166,9 +50166,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50269,9 +50269,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50573,9 +50573,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50602,9 +50602,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -50759,9 +50759,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51168,9 +51168,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51197,9 +51197,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51354,9 +51354,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51812,9 +51812,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51841,9 +51841,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -51998,9 +51998,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -52487,9 +52487,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -52516,9 +52516,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -52619,9 +52619,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -52922,9 +52922,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -52951,9 +52951,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -53108,9 +53108,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -53861,9 +53861,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -53890,9 +53890,9 @@ paths: vars: additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 @@ -54047,9 +54047,9 @@ paths: type: object - additionalProperties: anyOf: - - type: boolean - type: string - type: number + - type: boolean - items: type: string maxItems: 100 diff --git a/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.test.ts b/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.test.ts new file mode 100644 index 0000000000000..ead8a917442dd --- /dev/null +++ b/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.test.ts @@ -0,0 +1,28 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { SimplifiedVarsSchema } from './package_policy_schema'; + +describe('SimplifiedVarsSchema', () => { + it('should validate a string "true" as a string and not coerce it to boolean', () => { + const result = SimplifiedVarsSchema.validate({ myVar: 'true' }); + expect(result.myVar).toBe('true'); + expect(typeof result.myVar).toBe('string'); + }); + + it('should validate a string "false" as a string and not coerce it to boolean', () => { + const result = SimplifiedVarsSchema.validate({ myVar: 'false' }); + expect(result.myVar).toBe('false'); + expect(typeof result.myVar).toBe('string'); + }); + + it('should validate an actual boolean value correctly', () => { + const result = SimplifiedVarsSchema.validate({ myVar: true }); + expect(result.myVar).toBe(true); + expect(typeof result.myVar).toBe('boolean'); + }); +}); diff --git a/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.ts b/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.ts index 1eadefa2738d1..18c9b684bc93b 100644 --- a/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.ts +++ b/x-pack/platform/plugins/shared/fleet/common/types/models/package_policy_schema.ts @@ -320,9 +320,9 @@ export const SimplifiedVarsSchema = schema.recordOf( schema.string(), schema.nullable( schema.oneOf([ - schema.boolean(), schema.string(), schema.number(), + schema.boolean(), schema.arrayOf(schema.string(), { maxSize: 100 }), schema.arrayOf(schema.number(), { maxSize: 100 }), // Secrets