-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 80-s-asset-entity-manager
- Loading branch information
Showing
4 changed files
with
206 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/kbn-router-to-openapispec/src/oas_converter/kbn_config_schema/lib.test.util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* 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 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
|
||
export function createLargeSchema() { | ||
return schema.object({ | ||
string: schema.string({ maxLength: 10, minLength: 1 }), | ||
maybeNumber: schema.maybe(schema.number({ max: 1000, min: 1 })), | ||
booleanDefault: schema.boolean({ | ||
defaultValue: true, | ||
meta: { | ||
description: 'defaults to to true', | ||
}, | ||
}), | ||
ipType: schema.ip({ versions: ['ipv4'] }), | ||
literalType: schema.literal('literallythis'), | ||
neverType: schema.never(), | ||
map: schema.mapOf(schema.string(), schema.string()), | ||
record: schema.recordOf(schema.string(), schema.string()), | ||
union: schema.oneOf([ | ||
schema.string({ maxLength: 1, meta: { description: 'Union string' } }), | ||
schema.number({ min: 0, meta: { description: 'Union number' } }), | ||
]), | ||
uri: schema.uri({ | ||
scheme: ['prototest'], | ||
defaultValue: () => 'prototest://something', | ||
}), | ||
any: schema.any({ meta: { description: 'any type' } }), | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters