mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[data views] Reenable fields_for_wildcard response schema (#160054)
## Summary Restore fields_for_wildcard response schema validation.
This commit is contained in:
parent
cc6e1ef591
commit
a1cfc2db21
2 changed files with 8 additions and 4 deletions
|
@ -69,7 +69,6 @@ const fieldSubTypeSchema = schema.object({
|
|||
nested: schema.maybe(schema.object({ path: schema.string() })),
|
||||
});
|
||||
|
||||
// @ts-expect-error
|
||||
const FieldDescriptorSchema = schema.object({
|
||||
aggregatable: schema.boolean(),
|
||||
name: schema.string(),
|
||||
|
@ -90,6 +89,9 @@ const FieldDescriptorSchema = schema.object({
|
|||
])
|
||||
),
|
||||
timeSeriesDimension: schema.maybe(schema.boolean()),
|
||||
conflictDescriptions: schema.maybe(
|
||||
schema.recordOf(schema.string(), schema.arrayOf(schema.string()))
|
||||
),
|
||||
});
|
||||
|
||||
const validate: FullValidationConfig<any, any, any> = {
|
||||
|
@ -98,7 +100,6 @@ const validate: FullValidationConfig<any, any, any> = {
|
|||
// not available to get request
|
||||
body: schema.maybe(schema.object({ index_filter: schema.any() })),
|
||||
},
|
||||
/*
|
||||
response: {
|
||||
200: {
|
||||
body: schema.object({
|
||||
|
@ -107,7 +108,6 @@ const validate: FullValidationConfig<any, any, any> = {
|
|||
}),
|
||||
},
|
||||
},
|
||||
*/
|
||||
};
|
||||
|
||||
const handler: RequestHandler<{}, IQuery, IBody> = async (context, request, response) => {
|
||||
|
@ -188,5 +188,8 @@ export const registerFieldForWildcard = (
|
|||
router.versioned.post({ path, access }).addVersion({ version, validate }, handler);
|
||||
router.versioned
|
||||
.get({ path, access })
|
||||
.addVersion({ version, validate: { request: { query: querySchema } } }, handler);
|
||||
.addVersion(
|
||||
{ version, validate: { request: { query: querySchema }, response: validate.response } },
|
||||
handler
|
||||
);
|
||||
};
|
||||
|
|
|
@ -163,4 +163,5 @@ export interface FieldDescriptorRestResponse {
|
|||
timeZone?: string[];
|
||||
timeSeriesMetric?: 'histogram' | 'summary' | 'counter' | 'gauge';
|
||||
timeSeriesDimension?: boolean;
|
||||
conflictDescriptions?: Record<string, string[]>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue