inveniosoftware / domapping

Package generating elasticsearch mapping from jsonschemas
https://domapping.readthedocs.io
GNU General Public License v2.0
14 stars 8 forks source link

Simplify basic usage of schema_to_mapping ? #29

Open leplatrem opened 7 years ago

leplatrem commented 7 years ago

I'm only starting with converting jsonschema to elasticsearch mappings. Based on the amount of work you provided in this library, I have to admit this is not an easy task. But still, I have the feeling that it could have some default values to make first steps easier.

For example:

from domapping import schema_to_mapping

mapping = schema_to_mapping(json_schema)

Instead of:

from domapping.mapping import ElasticMappingGeneratorConfig, schema_to_mapping
root_url = json_schema.get("id", "")
mapping = schema_to_mapping(json_schema, root_url, {}, ElasticMappingGeneratorConfig())

Thanks!

(Just a suggestion, feel free to close this issue)