Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #2427
Closed
Open
Issue created Mar 16, 2019 by Administrator@rootContributor

[BUG] html2 generator JS error: "Cannot read property '$ref' of undefined"

Created by: quinncomendant

Description

The HTML output by the html2 generator gives this error when run in Chrome:

index.html:11 Uncaught TypeError: Cannot read property '$ref' of undefined
at HTMLDocument.<anonymous> (index.html:1288)
openapi-generator version

4.0.0-SNAPSHOT

OpenAPI declaration file content or url

The below yaml is valid as per:

[q@local] docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli validate -i /local/api.yaml
Validating spec (/local/api.yaml)
No validation issues detected.
openapi: 3.0.0
info:
  title: Anchor-ResMan adaptor
  description: A RESTful API for retrieval of property data cached by the Anchor-ResMan adapter background service.
  version: "1.0.0"
servers:
  - description: SwaggerHub API Auto Mocking
    url: https://virtserver.swaggerhub.com/strangecode/AnchorNW/1.0.0
paths:
  /properties:
    get:
      summary: get a list of properties
      operationId: searchProperties
      description: |
        Get a list of all properties, filtered by search criteria.
      parameters:
        - in: query
          name: searchString
          description: pass an optional search string for looking up inventory
          required: false
          schema:
            type: string
        - in: query
          name: skip
          description: number of records to skip for pagination
          schema:
            type: integer
            format: int32
            minimum: 0
        - in: query
          name: limit
          description: maximum number of records to return
          schema:
            type: integer
            format: int32
            minimum: 0
            maximum: 50
      responses:
        '200':
          description: properties results matching criteria
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Property'
        '400':
          description: bad input parameter
components:
  schemas:
    Property:
      type: object
      properties:
        propertyID:
          type: string
          format: uuid
          example: '31ed6cca-b03a-4fbd-a65f-0e8c5e578e34'
        name:
          type: string
          example: 'x UDG Everett LLC'
        streetAddress:
          type: string
          example: '316 NE 28th Avenue'
        city:
          type: string
          example: 'Portland'
        state:
          type: string
          example: 'OR'
        zip:
          type: string
          example: '97232'
        phone:
          type: string
          example: '(503) 726-7220'
        email:
          type: string
          example: 'info@anchornw.com'
        manager:
          type: string
          example: 'Mylisa Giroski'
        currentPeriodStart:
          type: string
          format: date
          example: '2019-01-01'
        currentPeriodEnd:
          type: string
          format: date
          example: '2019-01-31'
Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -g html2 -i /local/api.yaml -o /local
Steps to reproduce
  1. Generate html2 from the above YAML file.
  2. Open in Chrome
  3. See the errors in Chrome DevTools
Screen Shot 2019-03-16 at 13 32 10
Assignee
Assign to
Time tracking