# data-dictionary

## Structure

`/schemas` - place for jsonschema files

        /schemas
            /<report_type>
                /<version>
                    /<release date | YYYY-MM-DD>.json


It is possible to have many release dates within one minor version.

## How to use

All of these schemas should be placed in the S3 bucket.

- Get list of schemas for your report from S3
- Find the schema which has maximum date across all of the schemas that were released before the current report date. max[schema.date =< report.date]
- Convert your file to the object that can be validated with the given jsonschema (Python: Dict[str, Union[List, str, int, float, ...]])
- Validate

This algorithm is going to be implemented in a separate tool.

Deploy schemas to s3://$(STAGE)-delphi-configs/schemas
Default `STAGE` is `dev`

    make deploy

## Schema required fields
    delimiter is required for amazon and sme_max schema
    format_params is required for any reports which have specific formatting
    
for complete list of possible options look into sample_validator package
