openapi3-generator icon indicating copy to clipboard operation
openapi3-generator copied to clipboard

Empty table cells in markdown when using additionalProperties

Open farshidtz opened this issue 7 years ago • 1 comments

I use additionalProperties to define a dictionary as suggested here.

When the dictionary value is object, the resulting markdown will have rows for summaryAsHTML , descriptionAsHTML, generatedExample with empty cells in Type and Description columns. This somehow breaks the HTML parsing of the table.

openapi: 3.0.0

info:
  description: Test specs
  version: "0.0.0"
  title: Test specs

paths:
  /test:
    get:
      summary: retrieves a dictionary
      responses:
        '200':
          description: success response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: object
                  properties:
                    x:
                      type: string
                    y:
                      type: string
# Test specs

Test specs

## Table of Contents

* [Paths](#paths)
  - [`GET` /test](#op-get-test) 
* [Schemas](#schemas)




## Paths


### `GET` /test
<a id="op-get-test" />

> retrieves a dictionary








#### Responses


##### ▶ 200 - success response

###### Headers
_No headers specified_

###### application/json



<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Accepted values</th>
    </tr>
  </thead>
  <tbody>
      <tr>
        <td>Response</td>
        <td>
          object
        </td>
        <td></td>
        <td><em>Any</em></td>
      </tr>
      <tr>
        <td>Response.x</td>
        <td>
          string
        </td>
        <td></td>
        <td><em>Any</em></td>
      </tr>
      <tr>
        <td>Response.y</td>
        <td>
          string
        </td>
        <td></td>
        <td><em>Any</em></td>
      </tr>
      <tr>
        <td>Response.summaryAsHTML</td>
        <td>
          
        </td>
        <td></td>
        <td><em>Any</em></td>
      </tr>
      <tr>
        <td>Response.descriptionAsHTML</td>
        <td>
          
        </td>
        <td></td>
        <td><em>Any</em></td>
      </tr>
      <tr>
        <td>Response.generatedExample</td>
        <td>
          
        </td>
        <td></td>
        <td><em>Any</em></td>
      </tr>
  </tbody>
</table>



</div>

Any suggestions?

farshidtz avatar Nov 28 '18 10:11 farshidtz

Sorry, for some reason I missed this issue.

The reason is that the template doesn't iterate over additionalProperties and thus you don't get them. It would be just a matter of fixing the Markdown template.

fmvilas avatar Apr 29 '19 11:04 fmvilas