1 # The MIT License (MIT)
3 # Copyright (c) 2020 Philippe Proulx <pproulx@efficios.com>
5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be
14 # included in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 $schema: http://json-schema.org/draft-07/schema#
25 $id: https://barectf.org/schemas/config/3/field-type.json
26 title: Effective field type object
34 - $ref: '#/definitions/ft-base'
37 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/int-ft-size-prop
39 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/opt-int-min-1
41 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/opt-byte-order-prop
50 preferred-display-base: true
51 additionalProperties: false
54 - $ref: '#/definitions/bit-array-ft'
56 preferred-display-base:
57 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/opt-int-ft-preferred-display-base-prop
65 title: Unsigned integer field type object
67 - $ref: '#/definitions/int-ft'
68 - $ref: '#/definitions/int-ft-props'
71 $ref: '#/definitions/uint-ft-class-prop'
79 title: Signed integer field type object
81 - $ref: '#/definitions/int-ft'
82 - $ref: '#/definitions/int-ft-props'
85 $ref: '#/definitions/sint-ft-class-prop'
92 preferred-display-base: true
94 additionalProperties: false
121 preferred-display-base: true
123 additionalProperties: false
129 - unsigned-enumeration
131 title: Unsigned enumeration field type object
133 - $ref: '#/definitions/int-ft'
134 - $ref: '#/definitions/enum-ft'
135 - $ref: '#/definitions/enum-ft-props'
138 $ref: '#/definitions/uenum-ft-class-prop'
146 title: Signed enumeration field type object
148 - $ref: '#/definitions/int-ft'
149 - $ref: '#/definitions/enum-ft'
150 - $ref: '#/definitions/enum-ft-props'
153 $ref: '#/definitions/senum-ft-class-prop'
158 title: Real field type object
160 - $ref: '#/definitions/bit-array-ft'
163 $ref: '#/definitions/real-ft-class-prop'
173 additionalProperties: false
174 string-ft-class-prop:
180 title: String field type object
182 - $ref: '#/definitions/ft-base'
185 $ref: '#/definitions/string-ft-class-prop'
188 additionalProperties: false
189 static-array-ft-class-prop:
193 title: Static array field type object
195 - $ref: '#/definitions/ft-base'
198 $ref: '#/definitions/static-array-ft-class-prop'
200 $ref: '#/definitions/ft'
209 element-field-type: true
211 additionalProperties: false
212 struct-ft-class-prop:
221 $ref: '#/definitions/ft'
224 additionalProperties: false
230 '^[A-Za-z_][A-Za-z0-9_]*$':
231 $ref: '#/definitions/struct-ft-member'
235 title: Structure field type object
237 - $ref: '#/definitions/ft-base'
240 $ref: '#/definitions/struct-ft-class-prop'
242 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/opt-int-min-1
247 $ref: '#/definitions/struct-ft-members'
252 minimum-alignment: true
254 additionalProperties: false
257 - $ref: '#/definitions/ft-base'
259 # This is used to make sure that the field type's class name
260 # is valid as any of the conditionals below can fail.
262 # Although we could use `oneOf` instead of this enumeration
263 # here and refer to each of the `*-ft-class-prop` definitions,
264 # it would be hard for the validator to show something useful
265 # for the user as all cases would fail.
267 # Using `enum` below makes the validator show a very clear
268 # validation failure message.
279 - unsigned-enumeration
292 $ref: '#/definitions/uint-ft-class-prop'
294 $ref: '#/definitions/uint-ft'
298 $ref: '#/definitions/sint-ft-class-prop'
300 $ref: '#/definitions/sint-ft'
304 $ref: '#/definitions/uenum-ft-class-prop'
306 $ref: '#/definitions/uenum-ft'
310 $ref: '#/definitions/senum-ft-class-prop'
312 $ref: '#/definitions/senum-ft'
316 $ref: '#/definitions/real-ft-class-prop'
318 $ref: '#/definitions/real-ft'
322 $ref: '#/definitions/string-ft-class-prop'
324 $ref: '#/definitions/string-ft'
328 $ref: '#/definitions/static-array-ft-class-prop'
330 $ref: '#/definitions/static-array-ft'
334 $ref: '#/definitions/struct-ft-class-prop'
336 $ref: '#/definitions/struct-ft'
339 $ref: '#/definitions/ft'