File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
src/plugins/kibana_utils/public/field_mapping Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,19 @@ import { ES_FIELD_TYPES } from '../../../data/public';
2424/** @private */
2525type ShorthandFieldMapObject = FieldMappingSpec | ES_FIELD_TYPES | 'json' ;
2626
27- const json : FieldMappingSpec = {
28- type : 'text' as ES_FIELD_TYPES ,
29- _serialize ( v ) {
30- if ( v ) return JSON . stringify ( v ) ;
31- } ,
32- _deserialize ( v ) {
33- if ( v ) return JSON . parse ( v ) ;
34- } ,
35- } ;
36-
3727/** @public */
3828export const expandShorthand = ( sh : Record < string , ShorthandFieldMapObject > ) : MappingObject => {
3929 return mapValues < Record < string , ShorthandFieldMapObject > > ( sh , ( val : ShorthandFieldMapObject ) => {
4030 const fieldMap = isString ( val ) ? { type : val } : val ;
31+ const json : FieldMappingSpec = {
32+ type : ES_FIELD_TYPES . TEXT ,
33+ _serialize ( v ) {
34+ if ( v ) return JSON . stringify ( v ) ;
35+ } ,
36+ _deserialize ( v ) {
37+ if ( v ) return JSON . parse ( v ) ;
38+ } ,
39+ } ;
4140
4241 return fieldMap . type === 'json' ? json : fieldMap ;
4342 } ) as MappingObject ;
You can’t perform that action at this time.
0 commit comments