nussknacker icon indicating copy to clipboard operation
nussknacker copied to clipboard

Type suggestions and validations for avro enum types

Open arkadius opened this issue 5 years ago • 0 comments

Would be nice to have type sugestions or at least type validation for enum types. There are few mechanisms that can be used for that for now:

  1. We can provide dynamic dictionaries for all enum types and then expression will look like: #input.someEnumValue == #avro_enum.someEnum['first value']
  2. If we will have additional metadata in literals with value, we can declare that type is union of literal values and then just write #input.someEnumValue == 'mismatch value'. Suggestions won't work, but thanks to dynamic expression validation we will got message like type 'mismatch value' cann't be subclass of 'first value' | 'second value'. Type metadata could be useful also for other things like meta property with avro schema for better validation that writer schema is compatible with reader schema.

arkadius avatar Sep 01 '20 09:09 arkadius