Semprini / pyMDG

UML Model Driven Generation of schema, code, data and documentation.
Other
21 stars 10 forks source link

Avro template: Default value for union type must match first type from the union #73

Closed Semprini closed 4 months ago

Semprini commented 4 months ago

Actual: "type": [ "null", "string" ], "default": "__"

Expected: "type": [ "string", "null" ], "default": "__"

Semprini commented 4 months ago

Move {% if attr.dest_type != 'string' %} from start to {{ attr.dest_type }}

Line 73: }{% else %}"type": {% if not attr.is_id %}[ "string", "null", {% endif %}"{% if attr.dest_type != 'string' %}{{attr.dest_type}}{% endif %}"{% if not attr.is_id %} ], "default": "__"{% endif %}{% endif %}