0.0.5 • Published 2 years ago

@talendant/json-schema-to-es-index v0.0.5

Weekly downloads
Last release
2 years ago

= json-schema-to-es-index(1) Talendant, LLC v0.0.1 :doctype: manpage :manmanual: JSON-SCHEMA-TO-ES-INDEX :mansource: JSON-SCHEMA-TO-ES-INDEX :man-linkstyle: pass:blue R < >

== Name

json-schema-to-es-index - converts a Json Schema schema to an elastic search index

== Synopsis

json-schema-to-es-index OPTION...

== Options

-o, --out-file=OUT_FILE:: Write result to file OUT_FILE.

-s, --source=SOURCE_FILE:: The Json schema file to use as input OUT_FILE.

== Exit status

0:: Success. Elastic search index successfully generated

127:: Failure. Elastic search index failed to generate

== Description

This is an early release geared towards the needs of Talendant. We did just enough work to support our use case and will add more as we get drivers. We think its relatively complete at the moment, but use it at your own risk.

Most JSON Schema structures are supported, when one is not supported an error is emitted.

The default mappings generally work. When the a specific default needs to be overridden you can add a type decoration to the description to override the generated type. Type descriptions follow the format @es: followed by the elastic search type. For example, to override location element and have it be indexed as a geo_point, you add the @es:geo_point type decoration to the json schema.

source, json

{ $id: 'https://talendant.com/csv-import.json', $schema: 'http://json-schema.org/draft-07/schema#', title: 'candidate', description: 'Defines the format of a parsed csv file', type: 'object', required: 'name', 'location', 'uniqueIdentifiers',

properties: { name: { type: 'string', description: 'The name of the candidate.', }, uniqueIdentifiers: { $ref: '#/definitions/identifiers' }, location: { description: '@es:geo_point', properties: { lat: { type: 'number', description: 'The latitude of the ponit', }, lon: { type: 'number', description: 'The longitude of the point', }, }, additionalProperties: false, }, skills: { type: 'array', items: { type: 'string' }, }, history: { type: 'array', items: { $ref: '#/definitions/historyEntry' }, }, }, additionalProperties: false, definitions: { historyEntry: { type: 'object', properties: { username: { description: '@es:keyword', type: 'string' }, changedOn: { description: '@es:date', type: 'string', format: 'date-time', }, }, }, identifiers: { type: 'object', properties: { github: { description: '@es:keyword', type: 'string' }, gitlab: { description: '@es:keyword', type: 'string' }, twitter: { description: '@es:keyword', type: 'string' }, linkedin: { description: '@es:keyword', type: 'string' }, }, additionalProperties: false, }, },


== Resources

Project web site: http://pages.gitlab.com/json-schema-to-es-index

== Copying

Copyright (C) 2019 {author}. + Free use of this software is granted under the terms of the MIT License.


2 years ago


2 years ago


2 years ago


2 years ago


2 years ago