Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html2 generator does not include requestBody #1373

Closed
vishnugr opened this issue Nov 5, 2018 · 1 comment · Fixed by #18356
Closed

html2 generator does not include requestBody #1373

vishnugr opened this issue Nov 5, 2018 · 1 comment · Fixed by #18356

Comments

@vishnugr
Copy link

vishnugr commented Nov 5, 2018

Description

I have generated html2 documentation. But index.html does not include requestBody.
I need to know, how to add the requestBody in the documentation?

openapi-generator version

Version 3.3.2

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: service example
  version: 2.0.0
  description: service API's
paths:
  /api/v1/templates:
    post:
      summary: Add a new template
      deprecated: false
      security:
        - Token: []
      tags:
        - Templates
      requestBody:
        description: template to add into the system.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Templates'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Templates'
              example:
                $ref: '#/components/schemas/Templates'
                
components:
  schemas:
    Templates:
      title: Templates
      type: array
      items:
        properties:
          templateName:
            type: string
            description: Template Name
            example: abc
          test:
            type: string
            description: Template Id
            example: test
        required:
          - _id
Command line used for generation

openapi-generator generate -i swagger/swagger.yaml -g html2 -o docs/

Suggest a fix/enhancement

Generator needs to support for the body parameters and response examples to be included in index.html

@animeshkumar09
Copy link

Adding to the issue specified:-
if the Request body accepts List as a parameter.

Open API shown
[undefined]

image

But if the Request Body accepts an object, it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants