omissis / go-jsonschema

A tool to generate Go data types from JSON Schema definitions.
MIT License
566 stars 90 forks source link

Problems generating structs from schema. #194

Open ilijamt opened 7 months ago

ilijamt commented 7 months ago

I'm trying to generate the structs from https://unpkg.com/@atlaskit/adf-schema@35.5.1/dist/json-schema/v1/full.json

But I'm greeted with the following error:

go-jsonschema: Failed: error parsing from file ./schema.json: cannot load schema
error parsing JSON file schema.json: failed to unmarshal JSON: failed to unmarshal schema: failed to unmarshal type: failed to unmarshal type: failed to unmarshal type: failed to unmarshal type: json: cannot unmarshal array into Go value of type schemas.ObjectAsType

go-jsonschema: v0.15.0

survivorbat commented 3 months ago

Having the same issue

Found the problem, I had an array of strings in my schema and somehow that triggered the error. In any case, the error message could be a bit clearer :)