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
  • #1707
Closed
Open
Issue created Dec 18, 2018 by Administrator@rootContributor

[BUG][HTML] Vendor-specific media type breaks Example Data

Created by: john3300

Description

Using a vendor-specific media type causes the Example data section of the operation listing to be empty. Vendor-specific media types are fully supported by OpenAPI Spec 3.0 according to the 'Media Type Names' section on this page: https://swagger.io/docs/specification/media-types/

openapi-generator version

4.0.0-SNAPSHOT

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: Test
  description: Test YAML
  version: '1.0'
servers:
  - url: http://localhost
paths:
  /employees/{id}:
    get:
      operationId: getEmployeeById
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Success
          content:
            application/vnd.john3300+json;version=1.0:
              schema:
                $ref: '#/components/schemas/employee'
components:
  schemas:
    employee:
      type: object
      properties:
        name:
          type: string
      required:
        - name
Command line used for generation

java -jar openapi-generator-cli-4.0.0-20181217.102953-101.jar generate -g html -i test.yaml

Related issues/PRs

None that I've seen.

Suggest a fix

The code to generate these example sections needs to use a regex to be able to correctly parse these vendor-specific media types and also any additional parameters (e.g. `;version=1.0) that are present.

Assignee
Assign to
Time tracking