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
  • #3271
Closed
Open
Issue created Jul 03, 2019 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][C++][Pistache][Restbed] Array of objects does not generate model file

Created by: muttleyxd

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

Actual: When declaring array of objects (which have properties), model is not generated. It will result in Object.h include missing for cpp-restbed-server and cpp-pistache-server

Expected: model/ProblematicArrayType.h (and .cpp) are created

openapi-generator version

4.0.2

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  description: Some description
  version: 0.0.1
  title: Some title

tags:
  - name: hello

paths:
  "/there":
    get:
      operationId: helloThereGet
      tags:
        - hello
      summary: Do something
      responses:
        200:
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblematicArrayType"
servers:
  - url: http://localhost:8080
components:
  schemas:
    ProblematicArrayType:
      type: array
      items:
        type: object
        properties:
          someint:
            type: integer
            format: int32
          somestring:
            type: string
Command line used for generation

openapi-generator-cli generate -i problem.yaml -g cpp-pistache-server -o generated_pistache openapi-generator-cli generate -i problem.yaml -g cpp-restbed-server -o generated_restbed

Steps to reproduce
openapi-generator-cli generate -i problem.yaml -g cpp-pistache-server -o generated_pistache
cd generated_pistache
mkdir build
cd build
cmake ..
make -j4
Related issues/PRs

#2769 #1827 #1637

Suggest a fix

No idea how to fix it, but the issue happens both on Pistache and Restbed

Assignee
Assign to
Time tracking