-
Notifications
You must be signed in to change notification settings - Fork 87
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
can't provide field-specific descriptions of object types #132
Comments
Hi @cdmistman! Okay, I see what you mean, but I'm not sure if a fix is possible as this feature depends on the underlying implementation of Go. If there is a |
the problem i was working with was adding specifics to descriptions dependent on context. as mentioned, i'm using this schema in taplo which doesn't respect {
"foo": {
"type": "object",
"properties": {
"bar": {
"$ref": "#/$defs/bar",
"description": "foo's bar"
}
}
},
"bar": {
"description": "a bar",
"type": "object"
}
} it's been a while since i dug through the source code here, but iirc the schema generation doesn't call |
I'm trying to use a json schema using this go module to create a JSON schema for toml LSP provision using taplo. As such, I'm looking to make descriptions that are as useful as possible.
i have a type
Command
which is used often in the schema. in toml, a field of this type may be written as any of:the internal implementation looks something like (note i've configured
jsonschema
to use toml name declarations)now, i'd like to provide additional documentation about
onRun
andonCommand
. note that this is not possible usingjsonschema_description
in the field tag (and even if it did, it wouldn't help me in this situation, as i still want the description from theCommand
type). In order to accomplish this, I tried to do a little refactoring (looking at onlyonRun
):However, this doesn't work -
hello
is never printed. As it turns out, if a type hasJSONSchema
(even if it's implemented on the embedded struct),JSONSchemaExtend
is never called. I think this pattern is especially useful for this scenario, as taplo doesn't use thedescription
field of an object field which has$ref
The text was updated successfully, but these errors were encountered: