-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circular reference in OpenAPI spec is not resolved correctly #1052
Comments
@mdonkers i'm unable to replicate this, can you possibly share the full API definition that's throwing this? for example, this one passes validation: openapi: 3.1.0
info:
version: 1.0.0
title: Simple Petstore
description: This is a slimmed down single path version of the Petstore definition.
servers:
- url: https://httpbin.org
paths:
'/pet/{id}':
parameters:
- name: id
in: path
required: true
schema:
type: integer
put:
tags:
- pet
summary: Update a pet
description: This operation will update a pet in the database.
responses:
'400':
description: Invalid id value
security:
- apiKey: []
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
KeyValueList:
type: string
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:
- value |
Thanks for getting back to this. I tried to get a minimal reproducer but it was a bit more complex than I expected. There seem to be two preconditions to get this triggered:
Then running
|
Ah interesting, it may be that the reducer isn't running bundling in the right directory and is unable to properly load |
Diving into this further, and seeing it only happens with the imports, I'm getting to think the other issue I posted might very well be related: #1053 |
Hi,
Our OpenAPI spec (3.1.0) contains a circular reference that looks like:
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!
The text was updated successfully, but these errors were encountered: