You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thanks for this wonderful tool. This is the best open-source schema documentation generator I've stumbled upon so far. It does many things right and the Markdown output and the templating layer are fantastic. However, as the schema size scales, the tool reveals several issues that need improvement. I hope I will be able to contribute myself, but first the issues need to be raised and confirmed that this is not something that "works-as-designed".
Issue: items of composed schemas (allOf in my case) are displayed first no matter where they are really listed in the (sub)schema.
There are 3 simple properties and an if-then condition that adds a fourth property based on the value of the third property. Simple properties are defined before the branches and this is how the documentation is expected to be rendered: the first 3 properties are rendered first and the branching afterwards:
This becomes especially counterintuitive and difficult to read when the branching subtree goes several levels deep (and potentially references other schemas). In this case one would see the 3 root-level simple properties at the very bottom of the (potentially large) document which doesn't make any sense.
The text was updated successfully, but these errors were encountered:
Displaying allOf and the properties (as long as other type of blocks) in the order they appear would be difficult with the way the code is currently built. I have an idea to change that, but I'm not sure when I'll have/take time to work on something more than short/easy bugfixes.
An easy change would be to display properties first, I think it would be better than the current implementation, since properties are certain, while conditional blocks are not.
An easy change would be to display properties first (...) Do you think this would be a positive?
@dblanchette - sorry for resurrecting such an old issue... I concur this simple change would immensely help readability.
Is there any chance for it getting introduced (perhaps a config option even?) in the foreseeable future?
Hi,
thanks for this wonderful tool. This is the best open-source schema documentation generator I've stumbled upon so far. It does many things right and the Markdown output and the templating layer are fantastic. However, as the schema size scales, the tool reveals several issues that need improvement. I hope I will be able to contribute myself, but first the issues need to be raised and confirmed that this is not something that "works-as-designed".
Issue: items of composed schemas (
allOf
in my case) are displayed first no matter where they are really listed in the (sub)schema.Consider the following schema:
Click to expand
There are 3 simple properties and an if-then condition that adds a fourth property based on the value of the third property. Simple properties are defined before the branches and this is how the documentation is expected to be rendered: the first 3 properties are rendered first and the branching afterwards:
Click to expand
root
root > test_property01
root > test_property02
root > test_property03
root > allOf > item 0
root > allOf > item 0 > then > test_propertyA
root > allOf > item 1
root > allOf > item 1 > then > test_propertyB
Title: root
combining
Description: Root-level schema
Property
root > test_property01
string
Description: Test 01
^[a-z]{2,}[-_a-z0-9]+$
TestProperty
root > test_property02
integer
Description: Test 02
Property
root > test_property03
enum (of string)
Description: Test 03
Must be one of:
Property
root > allOf > item 0
object
If (test_property03 = "myvalue1")
object
Description: TBD
Property
root > allOf > item 0 > then > test_propertyA
string
Description: Test A
Property
root > allOf > item 1
object
If (test_property03 = "myvalue2")
object
Description: TBD
Property
root > allOf > item 1 > then > test_propertyB
string
Description: Test B
Generated using json-schema-for-humans on 2022-10-27 at 14:32:59 +0000
Actual result: the branching subschemas are rendered first, followed by the simple 3 properties:
Click to expand
root
root > allOf > item 0
root > allOf > item 0 > then > test_propertyA
root > allOf > item 1
root > allOf > item 1 > then > test_propertyB
root > test_property01
root > test_property02
root > test_property03
Title: root
combining
Description: Root-level schema
Property
root > allOf > item 0
object
If (test_property03 = "myvalue1")
object
Description: TBD
Property
root > allOf > item 0 > then > test_propertyA
string
Description: Test A
Property
root > allOf > item 1
object
If (test_property03 = "myvalue2")
object
Description: TBD
Property
root > allOf > item 1 > then > test_propertyB
string
Description: Test B
Property
root > test_property01
string
Description: Test 01
^[a-z]{2,}[-_a-z0-9]+$
TestProperty
root > test_property02
integer
Description: Test 02
Property
root > test_property03
enum (of string)
Description: Test 03
Must be one of:
Generated using json-schema-for-humans on 2022-10-27 at 14:32:59 +0000
This becomes especially counterintuitive and difficult to read when the branching subtree goes several levels deep (and potentially references other schemas). In this case one would see the 3 root-level simple properties at the very bottom of the (potentially large) document which doesn't make any sense.
The text was updated successfully, but these errors were encountered: