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
  • #6570
Closed
Open
Issue created Jun 05, 2020 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG] Description

Created by: neclimdul

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Documentation for swagger generated code seems to be missing the content type.

openapi-generator version

3.0.0-latest

This is a regression from swagger-codegen-cli where it is generated correctly.

OpenAPI declaration file content or url
swagger: '2.0'
info:
  title: test
  version: 1.0.0
consumes:
  - application/json
produces:
  - application/json
paths: 
  /person:
    post:
      operationId: createPerson
      responses:
        200:
          description: "Success"
          schema:
            type: object
Command line used for generation

I didn't test all generators but I did check java and php and the problem existed in both so it seems to be an underlying problem.

docker run --rm -v ${PWD}:/local/ openapitools/openapi-generator-cli:latest generate \
    -i /local/test.yaml -g java -o /local/.build
Steps to reproduce
  1. build the code using the above command
  2. Inspect the generated markdown in the documentation folder.

Expected:

### HTTP request headers
 
  - **Content-Type**: application/json
  - **Accept**: application/json

Actual:

### HTTP request headers
 
  - **Content-Type**: Not defined
  - **Accept**: application/json

ambiguous set of steps to reproduce the bug.-->

Related issues/PRs
Suggest a fix
Assignee
Assign to
Time tracking