---
includes:
  - has_namespace.yaml

type: object
additionalProperties: false
required: []

properties:
  output_dir:
    type: array
    default: [generated]
    items:
      type: string

  test_dir:
    type: array
    default: [apps, generated]
    items:
      type: string

  cpp_dir:
    type: array
    default: [src]
    items:
      type: string
  python_dir:
    type: array
    items:
      type: string

  plugins:
    type: array
    items:
      type: string
  custom:
    type: object

  clang_format:
    type: string
    default: clang-format

  command:
    type: string
    default: "\\"

  common:
    type: boolean
    default: true
  common_test:
    type: boolean
    default: true

  structs:
    type: object
    additionalProperties: false
    patternProperties:
      "^[a-zA-Z0-9-_.]+$":
        $ref: package://ifgen/schemas/Struct.yaml

  # Defaults for struct generation.
  struct:
    type: object
    additionalProperties: false
    required: []
    properties:
      codec:
        type: boolean
        default: true
      stream:
        type: boolean
        default: true
      methods:
        type: boolean
        default: true
      identifier:
        type: boolean
        default: true
      unit_test:
        type: boolean
        default: true
      packed:
        type: boolean
        default: true

      # https://en.cppreference.com/w/cpp/types/endian
      default_endianness:
        type: string
        default: native
        enum: [little, big, native]

      id_underlying: &id_underlying
        type: string
        default: uint16_t
        enum:
          - int8_t
          - int16_t
          - int32_t
          - int64_t

          - uint8_t
          - uint16_t
          - uint32_t
          - uint64_t

  enums:
    type: object
    additionalProperties: false
    patternProperties:
      "^[a-zA-Z0-9-_.]+$":
        $ref: package://ifgen/schemas/Enum.yaml

  # Defaults for enum generation.
  enum:
    type: object
    additionalProperties: false
    required: []
    properties:
      id_underlying: *id_underlying
      use_map:
        type: boolean
        default: true
      identifier:
        type: boolean
        default: true
      unit_test:
        type: boolean
        default: true

  ifgen:
    type: object
