-
Notifications
You must be signed in to change notification settings - Fork 172
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
oneOf in schema.json is showing null in generated documentaion #321
Comments
You could probably do this via custom templates for the docs, but I'm not sure I totally know what you want. Could you provide a small-ish sample schema that demonstrates what you mean? |
so with a schema.json like the one below, If I execute the doc command i get null for a but b comes as expected {
"$schema": "http://interagent.github.io/interagent-hyper-schema",
"type": [
"object"
],
"definitions": {
"a": {
"title": "a",
"description": "",
"type": [
"object"
],
"oneOf": [
{
"properties": {
"c": {
"type":"object",
"description":"c element"
}
},
"additionalProperties": false
},
{
"properties": {
"d": {
"type":"object",
"description":"d element"
}
},
"additionalProperties": false
}
],
"definitions":{
"identity": {
}
},
"links":[]
},
"b":{
"title": "a",
"type":"string",
"description": "b element",
"definitions":{
"identity": {
}
},
"links":[]
}
},
"properties": {
"a": {
"$ref": "#/definitions/a"
},
"b": {
"$ref": "#/definitions/b"
}
},
"links": [
{
"href": "https://xxx.com",
"rel": "self"
}
],
"id": "xxx",
"description":"xxx element",
"title": "",
"additionalProperties": false
} |
Ah. I wonder if you might have better luck if you reversed the nesting. So a would have the |
I tried that way but it only works when c and d enums .. I had to tweak the schemata.md.erb file to make it work for me. Thanks |
@sammyApe thanks for the update, glad to hear you found a workaround. Hopefully we can get this fixed/improved in the future so that wouldn't be needed. |
No description provided.
The text was updated successfully, but these errors were encountered: