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

[pistache-server] (C++ stub) - Optional type unknown - compile failed

Created by: CyrilleBenard

Description

I tried to follow the OpenAPI V3 tutorial but as soon as my openapi file uses the "Query parameters " my generated C++ code does not compile anymore.

See

  parameters:
    - name: limit
      in: query
      description: Limits the number of items on a page
      schema:
        type: integer
    - name: offset
      in: query
      description: Specifies the page number of the artists to be displayed
      schema:
        type: integer

Compile command line and error looks like :

  g++ -c  -I./api -I./model -I./impl -Wall -g -std=c++11 -o obj/api/DefaultApi.o api/DefaultApi.cpp
  In file included from api/DefaultApi.cpp:13:0:
  api/DefaultApi.h:72:36: error: ‘Optional’ does not name a type
       virtual void artists_get(const Optional<int32_t> &limit, const Optional<int32_t> &offset, Pistache::

My g++ version is 5.4.0 running on Gnome UBuntu 16.04

Is there any g++ version requirement or something I missed ?

openapi-generator version

v3.0.0

OpenAPI declaration file content or url

The openapi file is the one posted here See Parameters (sorry, the URL seems to be not fully handled)

Command line used for generation
  openapi-generator-cli.sh generate -i ../../api-ms1/openapi.yaml -g cpp-pistache-server -c ./config.json -o .
Steps to reproduce

Just generate and compile the code

Compile line is almost the standard one :

  g++ -c  -I./api -I./model -I./impl -Wall -g -std=c++11 -o obj/api/DefaultApi.o api/DefaultApi.cpp
Related issues/PRs

n/a

Suggest a fix/enhancement

No additional information

Assignee
Assign to
Time tracking