description: Autogenerated types based on OCPP JSON schemas
types:
{% for enum in enums %}
  {{ enum.name }}:
    description: >-
      {{ enum.description }}
    type: string
    enum:
{% for value in enum.values %}
      - "{{ value }}"
{% endfor %}
{% endfor %}
{% for type in types %}
  {{ type.name }}:
    description: >-
      {{ type.description }}
    type: object
    required:
{% if type.properties|selectattr('required', 'true')|list %}
{% for property in type.properties if property.required %}
      - {{ property.name | snake_case }}
{% endfor %}
{% else %}
      []
{% endif %}
    properties:
{% for property in type.properties %}
      {% if property.name != "customData" %}
      {{ property.name | snake_case }}:
        description: >-
          {{ property.description }}
        type: {{ property.type }}
        {% if property.type == "object" or property.enum %}
        $ref: /ocpp#/{{ property.ref }}
        {% endif %}
        {% if property.type == "array" %}
        items:
          type: {{ property.item.type }}
          {% if property.item.ref != None %}
          $ref: /ocpp#/{{ property.item.ref }}
          {% endif %}
        {% if property.item.min_items != None %}
        minItems: {{ property.item.min_items }}
        {% endif %}
        {% if property.item.max_items != None %}
        maxItems: {{ property.item.max_items }}
        {% endif %}
      {% endif %}
      {% endif %}
{% endfor %}
{% endfor %}
