Open
Description
Q&A
- OS: Windows 10
- Browser: does not matter (chrome, ff)
- Version: does not matter
- Swagger-UI version: http://editor.swagger.io/
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.0.1
info:
title: DbSync API
version: v1
paths:
'/api/v{version}/db-sync/generate-script':
post:
tags:
- DbSyncV1
parameters:
- name: version
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateScriptRequest'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/GenerateScriptResponse'
components:
schemas:
EntityRelatedType:
enum:
- None
- Direct
- Update
- LazyDirect
- Inverse
- Connected
type: string
EntityRelation:
type: object
properties:
sourceAttribute:
type: string
nullable: true
targetAttribute:
type: string
nullable: true
relatedType:
allOf:
- $ref: '#/components/schemas/EntityRelatedType'
filter:
type: string
nullable: true
additionalProperties: false
EntityMetadata:
type: object
properties:
name:
type: string
nullable: true
keys:
type: array
items:
type: string
nullable: true
relation:
allOf:
- $ref: '#/components/schemas/EntityRelation'
nullable: true
relatedEntities:
type: array
items:
$ref: '#/components/schemas/EntityMetadata'
nullable: true
additionalProperties: false
SourceEnvironment:
enum:
- Source1
- Source2
type: string
GenerateScriptRequest:
type: object
properties:
aggregateMetadata:
allOf:
- $ref: '#/components/schemas/EntityMetadata'
nullable: true
rootId:
type: integer
format: int32
source:
allOf:
- $ref: '#/components/schemas/SourceEnvironment'
additionalProperties: false
GenerateScriptResponse:
type: object
properties:
sqlScript:
type: string
nullable: true
additionalProperties: false
Describe the bug you're encountering
editor.swagger.io reports errors, when trying to expand schema description.
To reproduce...
Steps to reproduce the behavior:
- Go to editor.swagger.io
- Enter the YAML above
- Expand GenerateScriptRequest
- Scroll top and you'll see several errors: Resolver error - f is undefined
Additional context or thoughts
- Also there is no array element type displayed when I expand array relatedEntities in EntityMetadata
- Error is gone if I change the type of relatedType field in EntityRelation to string (just for example)
- There is an array in EntityMetadata that contains EntityMetadatas (is it considered as cycle?)
- The error happens when the object contains enum EntityRelatedType as descendant (if i replace it with SourceEnvironment error remains)
- The error happens only when expanding GenerateScriptRequest but not EntityMetadata or EntityRelation