question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

oneOf anyOf allOf break response schema table in markup

See original GitHub issue

Hi. Using a oneOf/anyOf/allOf in the following way seems to break the response schema table in the Slate Markdown/HTML generated by shins. I’ve created an example code base in https://github.com/simondean/widdershins-issues/tree/master/one-of-in-response-schema that demoes the issue.

Here’s a simplified version of the response schema I’m seeing the issue with:

{
    "type": "object",
    "properties": {
        "greeting": {
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "object",
                    "properties": {
                        "message1": {
                            "type": "string"
                        },
                        "message2": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "message1",
                        "message2"
                    ]
                }
            ]
        }
    },
    "additionalProperties": false,
    "required": [
        "greeting"
    ]
}

Actual markdown produced for this schema by widdershins + shins is the following. The blank lines in the middle of the table seem to break the table when it’s converted by shins into HTML. Everything above allOf is correctly converted into an HTML table by the rest just appears unformatted in the HTML.

|Name|Type|Required|Description|
|---|---|---|---|
|» greeting|any|true|No description|

*allOf*

|»» *anonymous*|string|false|No description|

*and*

|»» *anonymous*|object|false|No description|
|»»» message1|string|true|No description|
|»»» message2|string|true|No description|

Expected markdown could be something like this:

|Name|Type|Required|Description|
|---|---|---|---|
|» greeting|any|true|No description|
|*allOf*| | | |
|»» *anonymous*|string|false|No description|
|*and*| | | |
|»» *anonymous*|object|false|No description|
|»»» message1|string|true|No description|
|»»» message2|string|true|No description|

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
simondeancommented, Apr 5, 2018
0reactions
simondeancommented, Apr 13, 2018

@JLNNN I was seeing a different issue. The issue I was seeing what that only the first part of the table was rendering correctly for me (before the oneOf in your example). See https://simondean.github.io/widdershins-issues/one-of-in-response-schema/ for an example. My issue is fixed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

oneOf, anyOf, allOf, not - Swagger
oneOf – validates the value against exactly one of the subschemas; allOf ... The following JSON object is valid against both schemas, so...
Read more >
oneOf / anyOf / allOf - react-jsonschema-form documentation
react-jsonschema-form supports custom widgets for oneOf, anyOf, and allOf. A schema with oneOf is valid if exactly one of the subschemas is valid....
Read more >
TS 129 501 - V17.6.0 - 5G ; 5G System; Principles and Guidelines ...
Formatting of structured data types in query parameters . ... object using the "oneOf" , "anyOf" or "allOf" keyword to list alternative or...
Read more >
Chapter 17 Binding between XML Schema and Java Classes
Binding XML Schemas. This section describes the default XML-to-Java bindings used by JAXB. All of these bindings can be overridden on global or...
Read more >
GitLab Flavored Markdown (GLFM)
For more information, see the gitlab-markup gem project. ... Other languages are supported by adding a specifier to any of the existing ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found