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
47 preferred-display-base: true
48 additionalProperties: false
51 - $ref: '#/definitions/bit-array-ft'
53 preferred-display-base:
54 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/opt-int-ft-preferred-display-base-prop
62 title: Unsigned integer field type object
64 - $ref: '#/definitions/int-ft'
65 - $ref: '#/definitions/int-ft-props'
68 $ref: '#/definitions/uint-ft-class-prop'
76 title: Signed integer field type object
78 - $ref: '#/definitions/int-ft'
79 - $ref: '#/definitions/int-ft-props'
82 $ref: '#/definitions/sint-ft-class-prop'
88 preferred-display-base: true
90 additionalProperties: false
96 preferred-display-base: true
118 additionalProperties: false
126 - unsigned-enumeration
128 title: Unsigned enumeration field type object
130 - $ref: '#/definitions/int-ft'
131 - $ref: '#/definitions/enum-ft'
132 - $ref: '#/definitions/enum-ft-props'
135 $ref: '#/definitions/uenum-ft-class-prop'
143 title: Signed enumeration field type object
145 - $ref: '#/definitions/int-ft'
146 - $ref: '#/definitions/enum-ft'
147 - $ref: '#/definitions/enum-ft-props'
150 $ref: '#/definitions/senum-ft-class-prop'
155 title: Real field type object
157 - $ref: '#/definitions/bit-array-ft'
160 $ref: '#/definitions/real-ft-class-prop'
169 additionalProperties: false
170 string-ft-class-prop:
176 title: String field type object
178 - $ref: '#/definitions/ft-base'
181 $ref: '#/definitions/string-ft-class-prop'
184 additionalProperties: false
186 title: Array field type object
188 - $ref: '#/definitions/ft-base'
191 $ref: '#/definitions/ft'
194 static-array-ft-class-prop:
198 title: Static array field type object
200 - $ref: '#/definitions/array-ft'
203 $ref: '#/definitions/static-array-ft-class-prop'
209 element-field-type: true
211 additionalProperties: false
212 dynamic-array-ft-class-prop:
215 dynamic-array-ft-class-prop:
216 title: Dynamic array field type object
218 - $ref: '#/definitions/array-ft'
221 $ref: '#/definitions/dynamic-array-ft-class-prop'
224 element-field-type: true
225 additionalProperties: false
226 struct-ft-class-prop:
235 $ref: '#/definitions/ft'
238 additionalProperties: false
244 '^[A-Za-z_][A-Za-z0-9_]*$':
245 $ref: '#/definitions/struct-ft-member'
249 title: Structure field type object
251 - $ref: '#/definitions/ft-base'
254 $ref: '#/definitions/struct-ft-class-prop'
256 $ref: https://barectf.org/schemas/config/common/common.json#/definitions/opt-int-min-1
261 $ref: '#/definitions/struct-ft-members'
266 minimum-alignment: true
268 additionalProperties: false
271 - $ref: '#/definitions/ft-base'
273 # This is used to make sure that the field type's class name
274 # is valid as any of the conditionals below can fail.
276 # Although we could use `oneOf` instead of this enumeration
277 # here and refer to each of the `*-ft-class-prop` definitions,
278 # it would be hard for the validator to show something useful
279 # for the user as all cases would fail.
281 # Using `enum` below makes the validator show a very clear
282 # validation failure message.
293 - unsigned-enumeration
307 $ref: '#/definitions/uint-ft-class-prop'
309 $ref: '#/definitions/uint-ft'
313 $ref: '#/definitions/sint-ft-class-prop'
315 $ref: '#/definitions/sint-ft'
319 $ref: '#/definitions/uenum-ft-class-prop'
321 $ref: '#/definitions/uenum-ft'
325 $ref: '#/definitions/senum-ft-class-prop'
327 $ref: '#/definitions/senum-ft'
331 $ref: '#/definitions/real-ft-class-prop'
333 $ref: '#/definitions/real-ft'
337 $ref: '#/definitions/string-ft-class-prop'
339 $ref: '#/definitions/string-ft'
343 $ref: '#/definitions/static-array-ft-class-prop'
345 $ref: '#/definitions/static-array-ft'
349 $ref: '#/definitions/dynamic-array-ft-class-prop'
351 $ref: '#/definitions/dynamic-array-ft'
355 $ref: '#/definitions/struct-ft-class-prop'
357 $ref: '#/definitions/struct-ft'
360 $ref: '#/definitions/ft'