Open a-h opened 8 years ago
I get the same error. I can't give away the whole schema file, but it's not more complex than this:
{
"$schema": "http://json-schema.org/schema#",
"id": "http://some-domain.org/someschema.json#",
"description": "A JSON schema for ...",
"type": "object",
"properties": {
"field1": {
"description": "time indicator",
"type": "string",
"maxLength": 9,
"_comment": "some comment"
},
"field2": {
"description": "...",
"type": "string",
"minLength": 10,
"maxLength": 24,
"pattern": "^[0-9]{6}[A-Za-z]{3}[0-9]{1,15}(.[0-9]{1-15})?$"
},
},
"required": ["field1", "field2"],
"additionalProperties": false
}
I used ajv and an online verification tool and the format is valid according to both.
I found out that the JSON schema needs a title field for schematic to work
{
"title": "this-becomes-your-go-package-name",
//rest of the schema
}
When attempting to generate Go structs with this schema:
Using this command line:
The following error is returned: