Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMD: Swap smd.Definition type with smd.Property #45

Open
smyrman opened this issue Sep 16, 2019 · 0 comments
Open

SMD: Swap smd.Definition type with smd.Property #45

smyrman opened this issue Sep 16, 2019 · 0 comments

Comments

@smyrman
Copy link

smyrman commented Sep 16, 2019

type Definition struct {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant