Skip to content

Resolver error: f is undefined #5820

Open
@donRumatta

Description

@donRumatta

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:

  1. Go to editor.swagger.io
  2. Enter the YAML above
  3. Expand GenerateScriptRequest
  4. Scroll top and you'll see several errors: Resolver error - f is undefined

Additional context or thoughts

  1. Also there is no array element type displayed when I expand array relatedEntities in EntityMetadata
  2. Error is gone if I change the type of relatedType field in EntityRelation to string (just for example)
  3. There is an array in EntityMetadata that contains EntityMetadatas (is it considered as cycle?)
  4. The error happens when the object contains enum EntityRelatedType as descendant (if i replace it with SourceEnvironment error remains)
  5. The error happens only when expanding GenerateScriptRequest but not EntityMetadata or EntityRelation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions