Circular reference in schema leads to Could not resolve reference: undefined undefined
See original GitHub issueQ&A (please complete the following information)
- OS: Alpine Linux
- Browser: Vivaldi
- Version: 2.9
- Method of installation: docker
- Swagger-UI version: actually unknown, should be latest
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: "3.0.0"
info:
title: "Test API For Self Reference"
version: "1.0"
paths:
/greeting:
get:
tags:
- Client
description: 'Get the current client session identifier.'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Person'
components:
schemas:
Person:
type: object
required:
- name
- age
properties:
name:
type: string
example: 'John Doe'
age:
type: integer
example: 42
parent:
$ref: '#/components/schemas/Person'
brother:
$ref: '#/components/schemas/Person'
Swagger-UI configuration options: Where do I find it?
Describe the bug you’re encountering
When expanding the Person
schema, Swagger-UI displays this error on top of the page:
Resolver error at components.schemas.Person.properties.parent.$ref
Could not resolve reference: undefined undefined
To reproduce…
Steps to reproduce the behavior:
- Scroll down to ‘schemas’
- Click on ‘Person’ to expand it
- Scroll up to the top of the page
- See error
Expected behavior
No error should occur.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top Results From Across the Web
undefined Not Found" messages in Swagger UI 3 - Stack ...
The resolver sometimes chokes on deeply nested schemas, long allOf + $ref chains, and/or circular references. Here are similar issues in Swagger ...
Read more >Swagger $ref gives "Could not resolve reference: u...
Swagger $ref gives "Could not resolve reference: undefined undefined" so I'm trying to separate the objects that we give in the responses body ......
Read more >Using $ref - Swagger
$ref Syntax If the string value does not conform URI syntax rules, it causes an error during the resolving. Any members other than...
Read more >Circular reference is not allowed
Make sure that you have not defined any circular references for the schemas in your API. Copyright 2019—2022 42Crunch Ltd — All Rights...
Read more >Looker error catalog | Google Cloud
Validate once more to resolve the error. create_process parameter reference. Can't construct aggregate table (?), temporary schema for (?) is unset.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have met the same issue for using 3.25.2. I have a quick check and figure out the issue happened from 3.22.3 Have check on editor.swagger.io
it’s empty instead of throwing a warning on the top of the page.
The issue is still there (5 months later). Any fix foreseen ?