external-to-osm-tag-mapping is a RESTful service responsible for mapping between the external source feature metadata to our own MapColonies tags schema.
A schema defines the means by which an object is mapped to a new represntation. The new object will retain its properties and will append new properties (key-value pairs) defined by the mapping.
A schema defintion contains several ways to map existing properties to the appended properties as well as to manipulate their values.
required:
nameschema nameenableExternalFetchboolean whether to fetch mappings from external sourcecreatedAttimestamp when the schema was created (currently unused)addSchemaPrefixboolean whether to append schema'snameto the propertyexplodeKeyslist of keys to explode by with a combination of an object's value to append a set of new properties. e.g. anexplodeKeysof ['explode1'] with incoming {"explode1": "val1"} object, with a mapping of "explode1:val1" --> {"key1":"newval1"} will append the mapped value to object's new representationexplodePrefixprefix to add to exploded keys when querying an external sourcedomainPrefixprefix to add to domain keys when querying an external source
optional:
updatedAttimestamp when the schema was updated (currently unused)ignoreKeyslist of keys to ignore when mappingrenameKeysan object with keys to match the original keys and their values as their new keys
ℹ️ Note: current implementation uses Redis as the external source for tag mappings.
See the OpenAPI specification.
To load schemas you need to set a provider.
To set a provider use the SCHEMA_PROVIDER environment variable.
This provider loads schemas from a JSON file.
To select this provider set environment variable SCHEMA_PROVIDER to file.
To configure the schema file location set the SCHEMA_FILE_PATH environment variable.
Check schemas.json for some examples of schema definitions.
git clone https://github.com/MapColonies/external-to-osm-tag-mapping.git
cd external-to-osm-tag-mapping
npm install
npm run startClone the repo then build an image and push it to your container registry. Update values.yaml with values relevant for your release then deploy release with this command
cd helm
helm install external-to-osm-tag-mapping -f values.yaml .For integration tests to run correctly modify test.json in config folder to point to your Redis instance.
npm run test