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
  • #2024
Closed
Open
Issue created Jan 30, 2019 by Administrator@rootContributor

[BUG] [C++][Pistache-server] Object defined inside the body content does not compile

Created by: CyrilleBenard

Description

When the YAML file describes the use of an object inside the body content (without any content type like application/json), the generator produces a model file called InlineObject.h (and cpp) but to use it, the generator set the wrong include file name :

#include "Inline_object.h"

instead of

#include "InlineObject.h"

It seems that there is a confusion between the file name and the class name

class  Inline_object
    : public ModelBase
{
    ...
} ;
openapi-generator version

Current master 4.0.0-SNAPSHOT

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  version: 1.0.0
  title: Check generation of pistache
  description: Internal ref filename is check_object_immediately_in_the_content.yaml

servers:
  - url: http://localhost:8080

paths:
  /sm-contexts:
    post:
      summary:  Create SM Context
      tags:
        - SM contexts collection
      operationId: PostSmContexts
      requestBody:
        description: representation of the SM context to be created in the SMF
        required: true
        content:
          multipart/related:
            schema:
              type: object
              properties: # Request parts
                dataMessage:
                  type: string

      responses:
        '200':
          description: Everythings gonna be alright
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Content"
        default:
          description: unexpected error


components:
  schemas:
    Content:
      type: string
Command line used for generation

Generate :

openapi-generator-cli.sh generate -i ./openapi.yaml -g cpp-pistache-server -c ./config.json -o .

Compile :

g++ -c  -I./api -I./model -I./impl  -Wall -g -std=c++11 -o obj/api/SMContextsCollectionApi.o api/SMContextsCollectionApi.cpp
Steps to reproduce

Generate & compile

Related issues/PRs

N/A

Suggest a fix
Assignee
Assign to
Time tracking