The Definition type does not allow supplying Items. This means that even with a custom SMD() override method, it's not possible to correctly document arrays of arrays where the inner item type is explained.
It seams reasonable to me to just drop the smd.Definition type and use smd.Property, or perhaps drop that as well and go for just having the smd.JSONSchema type.
In addition, the Items type (map[string]string) appears odd; the only valid value wold be to supply a key "$ref" and a value pointing to a Definition, so it would make more sense to let it be of type struct {Ref string `json:"$ref"`}, or indeed JSONSchema that already has a Ref field defined. The latter would also allow for inline schemas.
zenrpc/smd/model.go
Line 85 in 10f2c48
The
Definitiontype does not allow supplyingItems. This means that even with a customSMD()override method, it's not possible to correctly document arrays of arrays where the inner item type is explained.It seams reasonable to me to just drop the
smd.Definitiontype and usesmd.Property, or perhaps drop that as well and go for just having thesmd.JSONSchematype.In addition, the
Itemstype(map[string]string)appears odd; the only valid value wold be to supply a key"$ref"and a value pointing to a Definition, so it would make more sense to let it be of typestruct {Ref string `json:"$ref"`}, or indeedJSONSchemathat already has aReffield defined. The latter would also allow for inline schemas.