[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