1#!/usr/bin/env python
2#
3# SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
4# SPDX-License-Identifier: Apache-2.0
5#
6import json
7import os
8from sys import stdin
9
10try:
11    import jsonschema
12except ImportError:
13    raise RuntimeError('You need to install jsonschema package to use validate command')
14
15input_json = ''
16for line in stdin:
17    input_json += line
18size_json = json.loads(input_json)
19with open(os.path.join(os.path.dirname(__file__), 'size_schema.json'), 'r') as schema_file:
20    schema_json = json.load(schema_file)
21jsonschema.validate(size_json, schema_json)
22print(input_json.strip('\n'))
23