The generator does not handle allOf/anyOf/oneOf properly if schemas include properties, and are not references.
See original GitHub issueThis schema:
{
"$id" : "id",
"title" : "title",
"description" : "desc",
"type" : "object",
"allOf": [
{ "properties": {
"type": { "enum": [ "one", "two" ] }
}, "required" : ["type"]
},
{ "properties": {
"test": { "type": "string" }
}, "required" : ["test"]
}
]
}
Produces this MarkDown:
# title Schema
id
desc
| Abstract | Extensible | Status | Custom Properties | Additional Properties | Defined In |
|----------|------------|--------|-------------------|-----------------------|------------|
| Can be instantiated | No | Experimental | Forbidden | Permitted | [protocol2.schema.json](protocol2.schema.json) |
# title Properties
| Property | Type | Required | Defined by |
|----------|------|----------|------------|
| [test](#test) | `string` | **Required** | title (this schema) |
| `*` | any | Additional | this schema *allows* additional properties |
## test
`test`
* is **required**
* type: `string`
* defined in this schema
### test Type
`string`
The “type” property disappears completely. However, this is a valid schema that requires both properties. Additionally, if you change one of the “allOf” elements to “$ref” with the same content, everything works just fine.
The same problem applies to anyOf and oneOf combinations.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How to use OpenAPI "oneOf" property with openapi-generator ...
It handles the same JSON objects though I am not 100% sure it is semanticaly equivalent in OpenAPI specification. Share.
Read more >JSON Schema references ($ref) - Opis
This keyword is an attempt to create extensible schemas. We do not recommend using it, unless you fully understand its behavior! The value...
Read more >Schema generation rules · GitBook - Goswagger.Io
We use simple schemas to describe parameters and headers for operations. Simple schemas are supported by go-swagger (including validation), but are not ......
Read more >The iBench Integration Metadata Generator - VLDB Endowment
mapping composition) that do not depend so directly on the characteristics of a schema hierarchy. Furthermore, this sce- nario generator is limited to...
Read more >json-schema-faker - npm
Start using json-schema-faker in your project by running `npm i ... required — All required properties are guaranteed, if not can be omitted ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

🎉 This issue has been resolved in version 4.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
I face the same issue, using
allOfand mixin a ref with properties.My schema:
And the generated markdown:
http://www.axa.ch/schemas/components/Link.json
name
namename Type
http://www.axa.ch/schemas/types/bpmid.json#properties
Properties
Properties of Link.
propertiesobjectproperties Type
objectwith following properties:hrefvaluehref
Href
URL of the Link.
hrefstringhref Type
stringvalue
Value
The value of the Link.
valuestringvalue Type
stringstyle
Style
Styles of Textarea.
styleobjectstyle Type
objectwith following properties:arrow"false"color"blue"listed"false"motion"false"arrow
Arrow
Whether or not to display an arrow icon or not.
arrowboolean"false"arrow Type
booleancolor
Color
Color of Link.
colorenum"blue"The value of this property must be equal to one of the known values below.
color Known Values
redwhitebluelisted
Listed
Whether or not to us lested style.
listedboolean"false"listed Type
booleanmotion
Motion
Whether or not to use animation upon hovering.
motionboolean"false"motion Type
boolean