definitions:
partial-field-type:
title: Partial field type object
- oneOf:
- - type: string
- - type: object
- allOf:
- - oneOf:
- - properties:
- class:
- type: string
- required:
- - class
- - properties:
- inherit:
- type: string
- required:
- - inherit
- - properties:
- $inherit:
- type: string
- required:
- - $inherit
- - properties:
- value-type:
- $ref: '#/definitions/partial-field-type'
- element-type:
- $ref: '#/definitions/partial-field-type'
- fields:
- type: object
- patternProperties:
- '':
- $ref: '#/definitions/partial-field-type'
- - type: 'null'
+ if:
+ type: object
+ then:
+ oneOf:
+ - properties:
+ class:
+ type: string
+ required:
+ - class
+ - properties:
+ inherit:
+ type: string
+ required:
+ - inherit
+ - properties:
+ $inherit:
+ type: string
+ required:
+ - $inherit
+ properties:
+ value-type:
+ $ref: '#/definitions/partial-field-type'
+ element-type:
+ $ref: '#/definitions/partial-field-type'
+ fields:
+ type: object
+ patternProperties:
+ '':
+ $ref: '#/definitions/partial-field-type'
+ else:
+ oneOf:
+ - type: string
+ - type: 'null'
type: object
properties:
metadata:
- type: string
- type: 'null'
opt-int-min-0:
- oneOf:
- - type: integer
- minimum: 0
- - type: 'null'
+ if:
+ type: integer
+ then:
+ minimum: 0
+ else:
+ type: 'null'
opt-field-type:
- oneOf:
- - $ref: https://barectf.org/schemas/2/config/field-type.json
- - type: 'null'
+ if:
+ type: object
+ then:
+ $ref: https://barectf.org/schemas/2/config/field-type.json
+ else:
+ type: 'null'
opt-struct-field-type:
- oneOf:
- - $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/struct-field-type
- - type: 'null'
+ if:
+ type: object
+ then:
+ $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/struct-field-type
+ else:
+ type: 'null'
trace:
title: Trace object
type: object
byte-order:
$ref: https://barectf.org/schemas/2/config/byte-order-prop.json
uuid:
- oneOf:
- - $ref: https://barectf.org/schemas/2/config/uuid-prop.json
- - type: string
- const: auto
- - type: 'null'
+ if:
+ type: string
+ then:
+ oneOf:
+ - $ref: https://barectf.org/schemas/2/config/uuid-prop.json
+ - type: string
+ const: auto
+ else:
+ type: 'null'
packet-header-type:
$ref: '#/definitions/opt-struct-field-type'
required:
- return-ctype
properties:
uuid:
- oneOf:
- - $ref: https://barectf.org/schemas/2/config/uuid-prop.json
- - type: 'null'
+ if:
+ type: object
+ then:
+ $ref: https://barectf.org/schemas/2/config/uuid-prop.json
+ else:
+ type: 'null'
description:
$ref: '#/definitions/opt-string'
freq:
- oneOf:
- - type: integer
- minimum: 1
- - type: 'null'
+ if:
+ type: integer
+ then:
+ minimum: 1
+ else:
+ type: 'null'
error-cycles:
$ref: '#/definitions/opt-int-min-0'
offset:
- oneOf:
- - type: object
- properties:
- cycles:
- $ref: '#/definitions/opt-int-min-0'
- seconds:
- $ref: '#/definitions/opt-int-min-0'
- additionalProperties: false
- - type: 'null'
+ if:
+ type: object
+ then:
+ properties:
+ cycles:
+ $ref: '#/definitions/opt-int-min-0'
+ seconds:
+ $ref: '#/definitions/opt-int-min-0'
+ additionalProperties: false
+ else:
+ type: 'null'
absolute:
$ref: '#/definitions/opt-bool'
return-ctype:
$ref: '#/definitions/opt-string'
additionalProperties: false
$default-stream:
- oneOf:
- - type: string
- pattern: '^[A-Za-z_][A-Za-z0-9_]*$'
- - type: 'null'
+ if:
+ type: string
+ then:
+ pattern: '^[A-Za-z_][A-Za-z0-9_]*$'
+ else:
+ type: 'null'
stream:
title: Stream object
type: object
$ref: '#/definitions/trace'
env:
title: Environment variables
- oneOf:
- - type: object
- patternProperties:
- '^[A-Za-z_][A-Za-z0-9_]*$':
- oneOf:
- - type: string
- - type: integer
- additionalProperties: false
- - type: 'null'
+ if:
+ type: object
+ then:
+ patternProperties:
+ '^[A-Za-z_][A-Za-z0-9_]*$':
+ oneOf:
+ - type: string
+ - type: integer
+ additionalProperties: false
+ else:
+ type: 'null'
clocks:
title: Clocks object
type: object
definitions:
byte-order-prop:
title: Byte order property value
- oneOf:
- - $ref: https://barectf.org/schemas/2/config/byte-order-prop.json
- - type: 'null'
+ if:
+ type: object
+ then:
+ $ref: https://barectf.org/schemas/2/config/byte-order-prop.json
+ else:
+ type: 'null'
align-prop:
title: Alignment property value
- oneOf:
- - type: integer
- minimum: 1
- - type: 'null'
+ if:
+ type: integer
+ then:
+ minimum: 1
+ else:
+ type: 'null'
encoding-prop:
title: Encoding property value
- oneOf:
- - type: string
- enum:
+ if:
+ type: string
+ then:
+ enum:
- utf8
- UTF8
- utf-8
- none
- None
- NONE
- - type: 'null'
+ else:
+ type: 'null'
int-field-type-class-prop:
type: string
enum:
byte-order:
$ref: '#/definitions/byte-order-prop'
base:
- type: string
- oneOf:
- - enum:
+ if:
+ type: string
+ then:
+ enum:
- bin
- oct
- dec
- hex
- - type: 'null'
+ else:
+ type: 'null'
encoding:
$ref: '#/definitions/encoding-prop'
property-mappings:
- oneOf:
- - type: array
- items:
- type: object
- properties:
- type:
- type: string
- const: clock
- name:
- type: string
- pattern: '^[A-Za-z_][A-Za-z0-9_]*$'
- property:
- type: string
- const: value
- required:
- - type
- - name
- - property
- additionalProperties: false
- minItems: 1
- maxItems: 1
- - type: 'null'
+ if:
+ type: array
+ then:
+ items:
+ type: object
+ properties:
+ type:
+ type: string
+ const: clock
+ name:
+ type: string
+ pattern: '^[A-Za-z_][A-Za-z0-9_]*$'
+ property:
+ type: string
+ const: value
+ required:
+ - type
+ - name
+ - property
+ additionalProperties: false
+ minItems: 1
+ maxItems: 1
+ else:
+ type: 'null'
required:
- class
- size
members:
type: array
items:
- anyOf:
- - type: string
- - type: object
- properties:
- label:
- type: string
- value:
- oneOf:
- - type: integer
- - type: array
- items:
- type: integer
- minItems: 2
- maxItems: 2
- required:
- - label
- - value
- additionalProperties: false
+ if:
+ type: object
+ then:
+ properties:
+ label:
+ type: string
+ value:
+ if:
+ type: array
+ then:
+ items:
+ type: integer
+ minItems: 2
+ maxItems: 2
+ else:
+ type: integer
+ additionalProperties: false
+ required:
+ - label
+ - value
+ else:
+ type: string
required:
- class
- value-type
min-align:
$ref: '#/definitions/align-prop'
fields:
- oneOf:
- - type: object
- patternProperties:
- '^[A-Za-z_][A-Za-z0-9_]*$':
- $ref: '#/definitions/field-type'
- additionalProperties: false
- - type: 'null'
+ if:
+ type: object
+ then:
+ patternProperties:
+ '^[A-Za-z_][A-Za-z0-9_]*$':
+ $ref: '#/definitions/field-type'
+ additionalProperties: false
+ else:
+ type: 'null'
required:
- class
additionalProperties: false
$schema: http://json-schema.org/draft-07/schema#
$id: https://barectf.org/schemas/2/config/include-prop.json
title: Inclusion property value
-oneOf:
- - type: string
- - type: array
- items:
- type: string
- minItems: 1
+if:
+ type: array
+then:
+ items:
+ type: string
+ minItems: 1
+else:
+ type: string