swagger-markdown icon indicating copy to clipboard operation
swagger-markdown copied to clipboard

Properties in response not shown when schema type is "object" having one array property

Open terrisgit opened this issue 5 years ago • 1 comments
trafficstars

swagger-markdown version 1.2.0

Input

---
  swagger: "2.0"
  host: "0.0.0.0:11116"
  basePath: "/"
  schemes: 
    - "http"
  info: 
    title: "REST API"
    version: "1"
  tags: []
  paths: 
    /v1/notifications/account/{accountId}: 
      get: 
        summary: "Retrieves all notifications for given accountId."
        operationId: "getV1NotificationsAccountAccountid"
        parameters: 
          - 
            type: "integer"
            name: "accountId"
            in: "path"
            required: true
          - 
            type: "array"
            description: "Optional properties to filter by. Can be multiple."
            x-constraint: 
              single: true
            items: 
              type: "string"
              enum: 
                - "read"
                - "completed"
            collectionFormat: "multi"
            name: "skip"
            in: "query"
            required: false
        tags: 
          - "v1"
        responses: 
          200: 
            schema: 
              type: "object"
              properties: 
                data: 
                  type: "array"
                  items: 
                    type: "object"
                    properties: 
                      notificationId: 
                        type: "integer"
                        description: "ID of the notification"
            description: "Successful"

Output

Notice for the Responses, the Schema column says only 'object' instead of saying it's an array of integers.

#  REST API
## Version: 1

### /v1/notifications/account/{accountId}

#### GET
##### Summary:

Retrieves all notifications for given accountId.

##### Parameters

| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ---- |
| accountId | path |  | Yes | integer |
| skip | query | Optional properties to filter by. Can be multiple. | No | [ string ] |

##### Responses

| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Successful | object |

terrisgit avatar Feb 06 '20 05:02 terrisgit

It doesn't seem to be related to array - this is just one example.

terrisgit avatar Feb 06 '20 21:02 terrisgit

:tada: This issue has been resolved in version 2.0.0-beta.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

syroegkin avatar Dec 25 '22 22:12 syroegkin

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

syroegkin avatar Dec 27 '22 14:12 syroegkin

Will Examples in responses be displayed ? at the moment it seems it cannot

matthiasg avatar Apr 05 '23 09:04 matthiasg

@matthiasg we do have it in fact. I just updated the example, check it here: https://github.com/syroegkin/swagger-markdown/blob/master/examples/petstore_simple.md#petsid If you have issues with your documents, please submit an issue with an example, it will make it easier for me to resolve it.

syroegkin avatar Apr 07 '23 19:04 syroegkin