-
Notifications
You must be signed in to change notification settings - Fork 60
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
object properties in resource view show description of object and not description of the property #41
Comments
I've a test case for this somewhere too, thanks for the example. There has been quite a lot of work and discussion around the context of property descriptions, and I was sure we'd got this right (for example, we have lots of resources that contain addresses which are defined as a standard, reusable definition. Each address instance is different though, so the description of each address property is taken from the property and not the referenced definition. I can confirm I can reproduce with your example. Will investigate, as we agree with you, that is the way it should be. There might be a subtle difference in our specifications. We will see... |
If you define the "second": {
"type": "object",
"description": "second property",
"items" : {
"$ref": "#/definitions/MyObject"
}
}
Fixing.... EDIT: Actually, we're convinced |
The problem seems to stem from I've opened an issue over there, so we'll see what they say. We've sent them quite a detailed report. go-openapi/spec#22 |
We've got the answer. JSON schema states that other properties in an object with $ref need to be ignored. http://json-schema.org/latest/json-schema-core.html#rfc.section.7 So what However, wrapping The correct solution (advised by the {
"first": {
"allOf" : [
{
"type": "object",
"description": "first property"
},
{
"$ref": "#/definitions/MyObject"
}
]
}
} Basically, merge the partial schema object, containing However, the current release of DapperDox doesn't process this correctly because it expects each element of the We're working on a more complete solution, so will leave this issue open. |
Great, thanks! |
Still working on this. It's a little complicated! |
I was testing some other schema and I found a solution with works:
I'm not sure if this is according to the spec but it is rendered as expected in dapperdox. |
In the list of properties of a resource, the description of an object is taken from the referenced object and not from the property. This gets confusing if the same object is used multiple times as different properties.
I would expect to see the description of the property and not the description of the object:
I tried to change it myself but my knowledge about Go is very poor.
The spec file I used:
The text was updated successfully, but these errors were encountered: