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
  • #6678
Closed
Open
Issue created Jun 15, 2020 by Administrator@rootContributor4 of 5 checklist items completed4/5 checklist items

[BUG][NodeJS-Express-Server ReferenceRequestBodies are not parsed by the controller

Created by: RalphBragg

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • [5] 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

The NodeJS Express Server generator controller.js does not process reference request bodies. Is there are a way to make it do so?

openapi-generator version

5

OpenAPI declaration file content or url
   post:
      operationId: organisationsOrganisationIdAuthorisationserversPOST
      parameters:
      - description: The organisation ID
        explode: false
        in: path
        name: OrganisationId
        required: true
        schema:
          $ref: '#/components/schemas/OrganisationId'
        style: simple
      requestBody:
        $ref: '#/components/requestBodies/AuthorisationServerRequest'
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorisationServer'
          description: Authorisation server response
        "400":
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequest'
          description: Bad Request
        "401":
          description: Unauthorized
        "404":
          description: Not found
        "406":
          description: Not Acceptable
        "500":
          description: Internal Server Error
        "502":
          description: Bad Gateway
      security:
      - authorizer: []
      summary: Create an Authorisation Server for the given organisation
      tags:
      - Authorisation Servers
      x-eov-operation-handler: controllers/AuthorisationServersController
Command line used for generation

OPENAPI_GENERATOR_VERSION=5.0.0-SNAPSHOT openapi-generator-cli generate -i /TrustFramework.yaml -o ./output -g nodejs-express-server

Steps to reproduce
  1. Generate the server.
  2. Test that GETs function correctly.
  3. Post's fail to process throwing an undefined exception in Controller.js collectRequestParams() const { content } = request.openapi.schema.requestBody; as content is undefined whent the requestbody is a reference.
Related issues/PRs
Suggest a fix

Can reference request bodies be handled

Assignee
Assign to
Time tracking