[BUG] [cpp-ue4] Missing AnyType declaration for any-type objects
Created by: madrazzl3
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The UE4 code generator produces invalid code (code that cannot be compiled) for arbitrary-type objects:
#pragma once
#include "BaseModel.h"
#include "AnyType.h"
...
AnyType MyValue;
...
Neither a header with name AnyType.h
is generated nor type AnyType
declared anywhere in a project.
openapi-generator version
master - 5.3.0
OpenAPI declaration file content or url
arrayOfSomething:
type: array
items: {}
nullable: true
Generation Details
openapi-generator generate -i https://gist.githubusercontent.com/madrazzl3/da2502b6816aaa98713cba75e595f373/raw/d53da8c6098167768c3e5b1ad1381467397d6a51/example-scheme.yaml -g cpp-ue4 -o generated-client/ --additional-properties=cppNamespace='api',unrealModuleName='MyAPI',modelNamePrefix=''
Steps to reproduce
- Generate UE4 client with any of available tools
- Try to build generated module
Related issues/PRs
Similar problem with other generators:
- #10036 (closed) Kotlin
- #7618 Swift (also #7617 (closed))
- #9969 C
- #7458 C#
- #6332 (closed) Typescript
- #6668 (closed) PhP
Suggest a fix
Add type mapping AnyType
-> TSharedPtr<FJsonValue>
to keep ability to parse fields later.