Closed aniketkapdule closed 4 months ago
There currently is no map
data type in the spec. https://datacontract.com/#data-types
@jochenchrist three options:
object
with additionalProperties
where one can define the types of the valuesmap
with values
field to define the substructuresNot sure where we should be heading. Any thoughts?
Created https://github.com/datacontract/datacontract-specification/issues/80 to discuss map
@jochenchrist Correct me if I am wrong, but I don't see any discussion about enum type. Should I raise a PR to also add enum
in the FieldType
?
Regarding enum
: I would prefer not to include enum as a logical data type in the specification. Such a data type is very rare. We have a property enum that we can use for this purpose, and we can set it accordingly during import and export.
Like this:
status:
type: string
required: true
description: order status
enum:
- PLACED
- SHIPPED
- DELIVERED
- CANCELLED
config:
avroType: enum
@jochenchrist I have made appropriate changes to accommodate enum
type, as you have mentioned above, I will remove the changes from datacontract/lint/schema.py
regarding map
type once this issue is closed and pr is merged.
Thank you for your contribution.
We added official support for Maps to the specification. 🎉
Also notice the new properties keys
and values
.
I also updated the code, resolved merge conflicts, and removed the workaround in datacontract/lint/schema.py
I also updated the code, resolved merge conflicts, and removed the workaround in datacontract/lint/schema.py
Thank you @jochenchrist, Looking forward to do more contributions 👍
Resolves issue #311
This PR adds enum and map type logic to the import avro_importer.py, resolving import errors.