# The MIT License (MIT) # # Copyright (c) 2020 Philippe Proulx # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. $schema: http://json-schema.org/draft-07/schema# $id: https://barectf.org/schemas/2/config/config.json title: Effective configuration object definitions: opt-bool: oneOf: - type: boolean - type: 'null' opt-string: oneOf: - type: string - type: 'null' opt-int-min-0: oneOf: - type: integer minimum: 0 - type: 'null' opt-field-type: oneOf: - $ref: https://barectf.org/schemas/2/config/field-type.json - type: 'null' opt-struct-field-type: oneOf: - $ref: https://barectf.org/schemas/2/config/field-type.json#/definitions/struct-field-type - type: 'null' trace: title: Trace object type: object properties: 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' packet-header-type: $ref: '#/definitions/opt-struct-field-type' required: - byte-order additionalProperties: false clock: title: Clock object type: object oneOf: - required: - $return-ctype - required: - return-ctype - allOf: - not: required: - $return-ctype - not: required: - return-ctype properties: uuid: oneOf: - $ref: https://barectf.org/schemas/2/config/uuid-prop.json - type: 'null' description: $ref: '#/definitions/opt-string' freq: oneOf: - type: integer minimum: 1 - 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' absolute: $ref: '#/definitions/opt-bool' return-ctype: $ref: '#/definitions/opt-string' $return-ctype: $ref: '#/definitions/opt-string' additionalProperties: false $default-stream: oneOf: - type: string pattern: '^[A-Za-z_][A-Za-z0-9_]*$' - type: 'null' stream: title: Stream object type: object properties: $default: $ref: '#/definitions/opt-bool' packet-context-type: $ref: '#/definitions/opt-struct-field-type' event-header-type: $ref: '#/definitions/opt-struct-field-type' event-context-type: $ref: '#/definitions/opt-struct-field-type' events: title: Events object type: object patternProperties: '^[A-Za-z_][A-Za-z0-9_]*$': $ref: '#/definitions/event' additionalProperties: false minProperties: 1 required: - events additionalProperties: false event: title: Event object type: object properties: log-level: $ref: '#/definitions/opt-int-min-0' context-type: $ref: '#/definitions/opt-struct-field-type' payload-type: $ref: '#/definitions/opt-struct-field-type' additionalProperties: false type: object properties: version: type: string enum: - '2.0' - '2.1' - '2.2' prefix: type: string allOf: - pattern: '^[A-Za-z_][A-Za-z0-9_]*$' - not: enum: - align - callsite - clock - enum - env - event - floating_point - integer - stream - string - struct - trace - typealias - typedef - variant options: title: Configuration options object type: object properties: gen-prefix-def: type: boolean gen-default-stream-def: type: boolean additionalProperties: false metadata: title: Metadata object type: object properties: trace: $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' clocks: title: Clocks object type: object patternProperties: '^[A-Za-z_][A-Za-z0-9_]*$': $ref: '#/definitions/clock' additionalProperties: false $default-stream: $ref: '#/definitions/opt-string' streams: title: Streams object type: object patternProperties: '^[A-Za-z_][A-Za-z0-9_]*$': $ref: '#/definitions/stream' additionalProperties: false minProperties: 1 required: - trace - streams additionalProperties: false required: - version - metadata additionalProperties: false