datacontract / datacontract-cli

CLI to manage your datacontract.yaml files
https://cli.datacontract.com
Other
438 stars 85 forks source link

JsonSchema importer doesn't support array types #305

Closed Plozano94 closed 2 months ago

Plozano94 commented 3 months ago

Hi there, trying JsonSchema importer seems to fail when a property item is an array. In order to test try:

Schema: myjsonschema.json

{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "eventId": { "type": "string" }, "eventName": { "type": "string" }, "eventCreationDate": { "type": "integer" }, "collections": { "type": "array", "items": [ { "type": "integer" } ] } }, "required": [ "eventId", "eventName", "eventCreationDate", "collections" ] } Command: "datacontract import --format jsonschema --source myjsonschema.json"

Error: imagen

RobertLD commented 3 months ago

I can replicate this, let me dig into it a bit more

jochenchrist commented 2 months ago

Implemented, target with release v0.10.11