mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Ensure that field mappings are given a type
This commit is contained in:
parent
2dcbbf6006
commit
675bb7c0c6
2 changed files with 16 additions and 1 deletions
|
@ -8,7 +8,9 @@ module.exports = Joi.object({
|
|||
name: Joi.string().required(),
|
||||
count: Joi.number().integer(),
|
||||
scripted: Joi.boolean(),
|
||||
mapping: Joi.object()
|
||||
mapping: Joi.object({
|
||||
type: Joi.string().required()
|
||||
}).unknown()
|
||||
})),
|
||||
fieldFormatMap: Joi.object()
|
||||
});
|
||||
|
|
|
@ -31,8 +31,21 @@ define(function (require) {
|
|||
.send(_.assign(createTestData().indexPatternWithMappings, {fields: {}}))
|
||||
.expect(400),
|
||||
|
||||
// Fields must have a name
|
||||
request.post('/index-patterns')
|
||||
.send(_.assign(createTestData().indexPatternWithMappings, {fields: [{count: 0}]}))
|
||||
.expect(400),
|
||||
|
||||
// Mapping requires type
|
||||
request.post('/index-patterns')
|
||||
.send(_.assign(createTestData().indexPatternWithMappings, {
|
||||
fields: [{
|
||||
'name': 'geo.coordinates',
|
||||
'count': 0,
|
||||
'scripted': false,
|
||||
'mapping': {'index': 'not_analyzed', 'doc_values': false}
|
||||
}]
|
||||
}))
|
||||
.expect(400)
|
||||
]);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue