Redoc: Child having same 'external inheritance' as parent is considered recursive

Created on 11 May 2018  路  5Comments  路  Source: Redocly/redoc

When a child schema inherits from the same schema as the parent, the child is considered recursive but I think it shouldn't.

    MessageApiSmsResponse:
      allOf:
        - type: object
          properties:
            messages:
              type: array
              items:
                $ref: '#/components/schemas/MessageApiSmsRecipientStatus'
        - $ref: '#/components/schemas/MessageApiResponseMessage'    
    MessageApiSmsRecipientStatus:
      allOf:
        - ...
        - $ref: '#/components/schemas/MessageApiResponseMessage'

gives

image

Most helpful comment

I can still reproduce the above error (2.0.0-rc.2).

Also the following example is reported as recursive:

openapi: 3.0.0
info:
  title: Test
  version: '0.1'
  contact: {}
paths:
  /objects:
    get:
      summary: Get objects
      responses:
        200:
          content:
            application/json:
              schema: {$ref: '#/components/schemas/ExtendedResponse'}
components:
  schemas:
    BaseObject:
      properties: {test: string}

    ExtendedObject:
      allOf:
        - $ref: '#/components/schemas/BaseObject'
        - description: Extended Object

    BaseResponse:
      properties:
        object: {$ref: '#/components/schemas/BaseObject'}

    ExtendedResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - properties:
            object: {$ref: '#/components/schemas/ExtendedObject'}

All 5 comments

I can still reproduce the above error (2.0.0-rc.2).

Also the following example is reported as recursive:

openapi: 3.0.0
info:
  title: Test
  version: '0.1'
  contact: {}
paths:
  /objects:
    get:
      summary: Get objects
      responses:
        200:
          content:
            application/json:
              schema: {$ref: '#/components/schemas/ExtendedResponse'}
components:
  schemas:
    BaseObject:
      properties: {test: string}

    ExtendedObject:
      allOf:
        - $ref: '#/components/schemas/BaseObject'
        - description: Extended Object

    BaseResponse:
      properties:
        object: {$ref: '#/components/schemas/BaseObject'}

    ExtendedResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - properties:
            object: {$ref: '#/components/schemas/ExtendedObject'}

I can still reproduce the above error (2.0.0-rc.2).

Also the following example is reported as recursive:

openapi: 3.0.0
info:
  title: Test
  version: '0.1'
  contact: {}
paths:
  /objects:
    get:
      summary: Get objects
      responses:
        200:
          content:
            application/json:
              schema: {$ref: '#/components/schemas/ExtendedResponse'}
components:
  schemas:
    BaseObject:
      properties: {test: string}

    ExtendedObject:
      allOf:
        - $ref: '#/components/schemas/BaseObject'
        - description: Extended Object

    BaseResponse:
      properties:
        object: {$ref: '#/components/schemas/BaseObject'}

    ExtendedResponse:
      allOf:
        - $ref: '#/components/schemas/BaseResponse'
        - properties:
            object: {$ref: '#/components/schemas/ExtendedObject'}

Me too! @RomanGotsiy it have been nearly one year, any update? 馃槒

I have this problem as well. Any news here?

Same problem here.

duplicated of #695

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonKohler picture JonKohler  路  3Comments

vietnguyen010 picture vietnguyen010  路  3Comments

martnst picture martnst  路  3Comments

JFCote picture JFCote  路  3Comments

typekpb picture typekpb  路  4Comments