Skip to content

Circular reference in OpenAPI spec is not resolved correctly #1052

@mdonkers

Description

@mdonkers

Hi,

Our OpenAPI spec (3.1.0) contains a circular reference that looks like:

openapi: 3.1.0
components:
  schemas:
    AnyValue:
      description: "AnyValue is used to represent any type of attribute value. AnyValue may contain a primitive value such as a string or integer or it may contain an arbitrary nested object containing arrays, key-value lists and primitives."
      type: object
      properties:
        stringValue:
          type: string
        boolValue:
          type: boolean
        intValue:
          type: string
          format: int64
        doubleValue:
          type: number
          format: double
        arrayValue:
          $ref: "#/components/schemas/ArrayValue"
        kvlistValue:
          $ref: "#/components/schemas/KeyValueList"
        bytesValue:
          type: string
          "format": byte

    ArrayValue:
      description: "ArrayValue is a list of AnyValue messages. We need ArrayValue as a message since oneof in AnyValue does not allow repeated fields."
      type: object
      properties:
        values:
          description: "Array of values. The array may be empty (contain 0 elements)."
          type: array
          items:
            $ref: "#/components/schemas/AnyValue"
      required:
        - values

We need this to correctly represent the OTLP (OpenTelemetry) wire format.

But the rdme command fails to validate or in any other way process this, with the following error:

$ rdme openapi:validate api.yml 
✖ Validating the API definition located at api.yml...

Token "ArrayValue" does not exist.

Other tools to generate both client and server endpoints correctly process the above structure.

It would be helpful if rdme could be updated to support this use case, or is there any known work-around possible?
(according to the OpenAPI specs, this scenario should be valid...)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions