santhosh-tekuri/jsonschema

Adding json tags to Schema type

Closed this issue · 1 comments

I would like to use the Schema type to programmatically generate the JSON schema itself.

Would you be open to accepting such an addition to the code?

Example:

type Schema struct {
	Location string `json:"location,omitempty"` // absolute location
.
.
.

Schema is never intended to regenerate json schema back. it is compiled representation that is suitable for validation purposes.

even if you add json tags, it will not work, you can not construct schema references and there are chances of running into infinite recursion during json marshal