We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Default enum value in schema is incorrectly compiled to variable name instead of string value color.avsc
{ "namespace": "com.michaelyu.test", "name": "color", "type": "record", "fields": [ { "name": "colorType", "type": { "type": "enum", "name": "colorTypes", "symbols": [ "red", "blue", "green" ] }, "default": "red" } ] }
color.ts snippet after compilation with error TS2304: Cannot find name 'red'
TS2304: Cannot find name 'red'
... export class color extends BaseAvroRecord implements colorInterface { ... public colorType: colorTypes = red; ...
the actual implementation could be related to #26
The text was updated successfully, but these errors were encountered:
I have the same issue. Is there a plan to fix this?
My schema:
{ "namespace": "ces.avro", "name": "DeskOrder", "type": "record", "fields": [ {"name": "Id", "type": "long"}, {"name": "SecurityId", "type": "long", "default": 0}, {"name": "SecurityIDSource", "type": ["null", "string"], "default": null}, {"name": "Direction", "type": {"name": "DirectionEnum", "type": "enum", "symbols": ["NONE", "BUY", "SELL"]}, "default": "NONE"}, {"name": "ReleasedStatus", "type": {"name": "ReleasedStatusEnum", "type": "enum", "symbols": ["NONE", "HOLD", "ACTIVE", "DONE"]}, "default": "NONE"}, {"name": "StartBD", "type": "long", "default": 0, "doc": "epoch seconds"}, {"name": "StopBD", "type": "long", "default": 0, "doc": "epoch seconds"}, {"name": "FillStatus", "type": {"name": "FillStatusEnum", "type": "enum", "symbols": ["NONE", "PARTIAL", "FILLED"]}, "default": "NONE"}, {"name": "Currency", "type": ["null", "string"], "default": null}, {"name": "TotalParAmount", "type": "double", "default": 0.0}, {"name": "FilledParAmount", "type": "double", "default": 0.0}, {"name": "UnFilledParAmount", "type": "double", "default": 0.0} ] }
The resulting code for the "Direction field is public Direction: DirectionEnum = NONE;
instead of public Direction: DirectionEnum = DirectionEnum.NONE;
Sorry, something went wrong.
No branches or pull requests
Default enum value in schema is incorrectly compiled to variable name instead of string value
color.avsc
color.ts snippet after compilation with error
TS2304: Cannot find name 'red'
the actual implementation could be related to #26
The text was updated successfully, but these errors were encountered: