Skip to content

ORD validator fails when start_time/end_time used instead of datetime #4

@ritvje

Description

@ritvje

For the datetime fields, the JSON schema requires either datetime or both start_datetime and end_datetime. But if the second option is used, the validator fails when printing the success message due to the missing properties/datetime field.

Schemas: ['./schemas/openradardata-spec.json', 'data/202507070500_composite_cappi_600_acrr24h_finradfast_qc.json']
Read Openradar schema: ./schemas/openradardata-spec.json
Read msg: data/202507070500_composite_cappi_600_acrr24h_finradfast_qc.json
Traceback (most recent call last):
  File "/home/ritvanen/Documents/PAK_koodit/openradardata-validator/ord_validator.py", line 35, in <module>
    print("Validation OK: {0} {1}\t{2}\t{3}".format(msg["properties"]["datetime"], msg["properties"]["platform"], msg["properties"]["level"], msg["properties"]["content"]["standard_name"]))
                                                    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'datetime'

Example file: 202507070500_composite_cappi_600_acrr24h_finradfast_qc.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions