summaryrefslogtreecommitdiff
path: root/gr-utils/python/blocktool/core/outputschema.py
blob: 4d1bcf88b72415f00f2f4da1eb7f03c6e4e68667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#
# Copyright 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Schema to be strictly followed be parsed header output """


RESULT_SCHEMA = {
    "title": "JSON SCHEMA TO BE FOLLOWED BY BLOCK HEADER PARSING TOOL",
    "description": "Schema designed for the header file parsed python dict output",
    "type": "object",
    "properties": {
        "namespace": {
            "description": "List of nested namspace",
            "type": "array",
            "minItems": 1,
            "uniqueItems": True,
            "items": {
                "type": "string",
                "minLength": 1
            }
        },
        "class": {
            "description": "Class name",
            "type": "string",
            "minLength": 1
        },
        "io_signature": {
            "description": "I/O signature",
            "type": "object",
            "properties": {
                "input": {
                    "description": "Input ports",
                    "type": "object"
                },
                "output": {
                    "description": "Output ports",
                    "type": "object"
                }
            },
            "required": ["input", "output"]
        },
        "make": {
            "description": "Make function",
            "type": "object",
            "properties": {
                "arguments": {
                    "description": "Arguments of make function",
                    "type": "array",
                    "minItems": 1,
                    "uniqueItems": True,
                    "items": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "minLength": 1
                            },
                            "dtype": {
                                "type": "string",
                                "minLength": 1
                            },
                            "default": {
                                "type": "string"
                            }
                        },
                        "required": ["name"],
                        "dependencies": {
                            "name": [
                                "dtype",
                                "default"
                            ]
                        }
                    }
                }
            }
        },
        "methods": {
            "description": "Setters",
            "type": "array",
            "minItems": 0,
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 1
                    },
                    "arguments_type": {
                        "type": "array",
                        "uniqueItems": True,
                        "properties": {
                            "name": {
                                "type": "string",
                                "minLength": 1
                            },
                            "dtype": {
                                "type": "string",
                                "minLength": 1
                            }
                        },
                        "required": ["name"],
                        "dependencies": {
                            "name": ["dtype"]
                        }
                    }
                },
                "required": ["name"]
            }
        },
        "properties": {
            "description": "Getters",
            "type": "array",
            "uniqueItems": True,
            "items": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "minLength": 1
                    },
                    "dtype": {
                        "type": "string",
                        "minLength": 1
                    },
                    "read_only": {
                        "type": "boolean"
                    }
                },
                "required": ["name"],
                "dependencies": {
                    "name": [
                        "dtype",
                        "read_only"
                    ]
                }
            }
        },
        "docstring": {
            "description": "documentation of the header file",
            "type": "array"
        }
    },
    "required": [
        "namespace",
        "class",
        "io_signature",
        "make",
        "methods",
        "properties",
        "docstring"
    ]
}