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

[C++] ByteArray type is generated but unknown in C++

Created by: CyrilleBenard

Description

The generator produces a #include "ByteArray.h" and ByteArray type usage whereas it does not exist in C++ I can't find what I'm suppose to DL or install to satisfy the compiler (?)

EDIT: Same issue with Object.h and Object type

Issue exists at least for languages

  • cpp-pistache-server
  • cpp-restsdk
openapi-generator version

3.0.3-SNAPSHOT

OpenAPI declaration file content or url
openapi: "3.0.0"
info:
  version: 1.0.0
  title: Check ByteArray
servers:
  - url: http://localhost:8080
paths:
  /CheckByteArray:
    get:
      summary: Check Byte Array generation
      operationId: list
      tags:
        - Check
      responses:
        '200':
          description: Every things gonna be alright
          headers:
            x-next:
              description: A link to the next page of responses
              schema:
                type: string
          content:
            application/json:    
              schema:
                $ref: "#/components/schemas/Content"
      default:
        description: unexpected error
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Content"

components:
  schemas:
    Bytes:
      format: byte
      type: string

    Content:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/Bytes'
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Check ByteArray"
  },
  "servers": [
    {
      "url": "http://localhost:8080"
    }
  ],
  "paths": {
    "/CheckByteArray": {
      "get": {
        "summary": "Check Byte Array generation",
        "operationId": "list",
        "tags": [
          "Check"
        ],
        "responses": {
          "200": {
            "description": "Every things gonna be alright",
            "headers": {
              "x-next": {
                "description": "A link to the next page of responses",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Content"
                }
              }
            }
          }
        },
        "default": {
          "description": "unexpected error",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Content"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Bytes": {
        "format": "byte",
        "type": "string"
      },
      "Content": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/Bytes"
          }
        }
      }
    }
  }
}
Command line used for generation

generate -i ./openapi.yaml -g cpp-pistache-server -o .

Steps to reproduce
g++ -c  -I./api -I./model -I./impl -Wall -g -std=c++11 -o obj/model/Content.o model/Content.cpp
In file included from model/Content.cpp:14:0:
model/Content.h:24:23: fatal error: ByteArray.h: No such file or directory

See also the model/Content.cpp content to identify some ByteArray type usage

Related issues/PRs

N/A

Suggest a fix/enhancement
Assignee
Assign to
Time tracking