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

[cpp-pistache-server] Bug: not generating all files and methods

Created by: mjk4

Description

cpp-pistache-server can generate code which does not compile because it's missing files and methods:

- There are files which have `#include "Object.h"` but no `Object.h` file was generated anywhere.
- `model/AsdfInfo.cpp`'s `AsdfInfo::fromJson` includes a call to `setAttributes` but
  no such method was generated for `AsdfInfo`.
openapi-generator version

It's 3.3.4 but I've seen the Object.h issue in 3.3.2 and 3.3.3 though I worked around it temporarily by writing my own Object.h file. The missing setAttributes call seems to be new in 3.3.4

OpenAPI declaration file content or url

This is the mini.yaml file that reproduces the issue:

openapi: "3.0.0"
info:
  version: "1.0"
  title: An API
paths:
  /asdfs:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/asdfInfo'
      responses:
        201:
          description: "Created"
          content:
            application/json:
              schema:
                type: object
                properties:
                  asdfId:
                    type: integer
                    format: int64
components:
  schemas:
    asdfInfo:
      type: object
      properties:
        attributes:
          type: object
Command line used for generation
  • java -version is:
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
  • OS is "CentOS Linux release 7.5.1804 (Core)
  • using Apache Maven 3.3.9
Steps to reproduce

Steps:

  • Ran mvn clean package
  • Using the newly-created modules/openapi-generator-cli/target/openapi-generator-cli.jar
    • Call it $JAR
  • Run java -jar $JAR generate -i mini.yaml -g cpp-pistache-server -o gen_output
    • (mini.yaml is above)
  • Look inside gen_output and notice these issues:
    • There are files which have #include "Object.h" but no Object.h file was generated anywhere.
    • model/AsdfInfo.cpp's AsdfInfo::fromJson includes a call to setAttributes but no such method was generated for AsdfInfo.
Assignee
Assign to
Time tracking