swagger2markup icon indicating copy to clipboard operation
swagger2markup copied to clipboard

AllOf + $ref + Array + $ref is somehow skipped

Open mauricio-morales opened this issue 8 years ago • 1 comments

Swagger2Markup version: 1.3.0 (also happens in 1.2.0)

Problem description: When using the following response setup in my swagger YAML:

      responses:
        '200':
          description: Success
          schema:
            allOf:
            - "$ref": "#/definitions/APIResponse"
            - type: object
              properties:
                data:
                  type: array
                  items:
                    "$ref": "#/definitions/Folder"

The adoc output simply generates a "No Content" spec:

==== Responses

[options="header", cols=".^2,.^14,.^4"]
|===
|HTTP Code|Description|Schema
|**200**|Success|No Content
|**401**|Unauthorized access. Please log in first.|No Content
|**403**|Forbidden. You don't have access to this particular API resource.|No Content
|===

This is a full small swagger spec that reproduces the issue:

---
swagger: '2.0'
info:
  title: Bad Spec
  contact:
    name: Developer
    email: [email protected]
  version: '1.0'
host: my.api.com
basePath: "/"
schemes:
- https
produces:
- application/json
paths:
  "/Folders":
    get:
      tags:
      - Folders
      summary: Retrieves all folders for the current user.
      responses:
        '200':
          description: Success
          schema:
            allOf:
            - "$ref": "#/definitions/APIResponse"
            - type: object
              properties:
                data:
                  type: array
                  items:
                    "$ref": "#/definitions/Folder"
        '401':
          "$ref": "#/responses/401"
        '403':
          "$ref": "#/responses/403"
definitions:
  APIResponse:
    type: object
    properties:
      status:
        type: string
        enum:
        - Success
        - InvalidRequest
        - Unauthorized
        - Forbidden
        - NotFound
        - ServiceError
        - ServiceUnavailable
      errors:
        type: array
        items:
          type: object
          properties:
            code:
              type: integer
              format: int32
            type:
              type: string
            message:
              type: string
      forensics:
        type: array
        items:
          type: object
  Folder:
    type: object
    properties:
      FolderID:
        type: string
responses:
  '401':
    description: Unauthorized access. Please log in first.
  '403':
    description: Forbidden. You don't have access to this particular API resource.

mauricio-morales avatar Mar 01 '17 16:03 mauricio-morales

Thx. I try to reproduce it.

RobWin avatar Mar 01 '17 17:03 RobWin