Redoc: False positive recursion

Created on 9 Jan 2020  路  8Comments  路  Source: Redocly/redoc

Hello there, wrestling following issue.

Imagine I want to reuse some schema, let's say ID 鈥撀營 have following in ./helpers/id.yaml:

properties:
  id:
    type: number
required:
  - id

And here is a simple OpenAPI, which should result in a simple structure of three nested objects, which all wants to reference the id helper.

openapi: 3.0.0
info:
  title: False positive recursion
  version: '3.0'
paths:
  /documents:
    get:
      summary: Example
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: ./helpers/id.yaml
                  - properties:
                      second:
                        allOf:
                          - $ref: ./helpers/id.yaml
                          - properties:
                              third:
                                allOf:
                                  - $ref: ./helpers/id.yaml
                                  - properties:
                                      something:
                                        type: string

Whereas the first and second object are correctly rendered with required id attribute, the third object is flagged as recursive:

image

Any idea? Is it a bug or am I missing something?

bug

Most helpful comment

It is a bug. I will investigate it when I have time

All 8 comments

It is a bug. I will investigate it when I have time

I had the same problem with a string property. It seems to appear with the use of allOf and basic types (integer, string, ...) simultaneously.
In this case, the components/schemas/ seems to be replaced by the basic type and result of a false recursion in Redoc.

I have the same issue and can provide another reproduction example, if required.

Any news on how this issue is progressing? I could also provide additional examples if needed.

@jlaw90 looks like you may have a solution to the problem in https://github.com/jlaw90/redoc/commit/5f23b7add1e42a9cd9131413b7426697c64a8bf8, is this something you're planning to make a PR proposal for anytime soon? Would be greatly appreciated 馃帀

@remnestal I just rebased the commit from #1186 to see if it fixed the problem for us but it didn't - I haven't had time to investigate further unfortunately

I have the same problem, I created the issue #1439.

Looks like this might not be a problem anymore with the latest version of redoc-cli 馃し

Looks like this might not be a problem anymore with the latest version of redoc-cli shrug

I tried it whith the latest version 0.10.1 and there is still the problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahshum picture ahshum  路  3Comments

vietnguyen010 picture vietnguyen010  路  3Comments

RomanHotsiy picture RomanHotsiy  路  3Comments

RamakrishnaChilaka picture RamakrishnaChilaka  路  3Comments

gavinkalika picture gavinkalika  路  3Comments