Skip to content

Commit c377907

Browse files
committed
Added cpp-oatpp-client.
1 parent f659457 commit c377907

30 files changed

Lines changed: 2552 additions & 0 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ samples/client/petstore/cpp-restsdk/client/cmake_install.cmake
9292
samples/client/petstore/cpp-restsdk/client/CppRestPetstoreClientConfig.cmake
9393
samples/client/petstore/cpp-restsdk/client/CMakeCache.txt
9494

95+
# cpp-oatpp
96+
samples/client/petstore/cpp-oatpp/build
97+
samples/client/petstore/cpp-oatpp/external
98+
samples/server/petstore/cpp-oatpp/build
99+
samples/server/petstore/cpp-oatpp/external
100+
95101
#Java/Android
96102
**/.gradle
97103
samples/client/petstore/java/hello.txt

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ Here is a list of template creators:
10251025
* Apex: @asnelling
10261026
* Bash: @bkryza
10271027
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
1028+
* C++ Oat++: @Kraust
10281029
* C++ REST: @Danielku15
10291030
* C++ Tiny: @AndersSpringborg @kaareHH @michelealbano @mkakbas
10301031
* C++ UE4: @Kahncode

bin/configs/cpp-oatpp-client.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
generatorName: cpp-oatpp-client
2+
outputDir: samples/client/petstore/cpp-oatpp
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-oatpp-client/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/cpp-oatpp-client
5+
additionalProperties:
6+
addExternalLibs: "true"

docs/generators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The following generators are available:
1212
* [bash](generators/bash.md)
1313
* [c](generators/c.md)
1414
* [clojure](generators/clojure.md)
15+
* [cpp-oatpp-client](generators/cpp-oatpp-client.md)
1516
* [cpp-qt-client](generators/cpp-qt-client.md)
1617
* [cpp-restsdk](generators/cpp-restsdk.md)
1718
* [cpp-tiny (beta)](generators/cpp-tiny.md)
Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
---
2+
title: Documentation for the cpp-oatpp-client Generator
3+
---
4+
5+
## METADATA
6+
7+
| Property | Value | Notes |
8+
| -------- | ----- | ----- |
9+
| generator name | cpp-oatpp-client | pass this to the generate command after -g |
10+
| generator stability | STABLE | |
11+
| generator type | CLIENT | |
12+
| generator language | C++ | |
13+
| generator default templating engine | mustache | |
14+
| helpTxt | Generates a C++ client library (based on oat++). | |
15+
16+
## CONFIG OPTIONS
17+
These options may be applied as additional-properties (cli) or configOptions (plugins). Refer to [configuration docs](https://openapi-generator.tech/docs/configuration) for more details.
18+
19+
| Option | Description | Values | Default |
20+
| ------ | ----------- | ------ | ------- |
21+
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
22+
|contentCompression|Enable Compressed Content Encoding for requests and responses| |false|
23+
|cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI|
24+
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.</dd></dl>|true|
25+
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
26+
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
27+
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C# have this enabled by default).|<dl><dt>**true**</dt><dd>The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.</dd><dt>**false**</dt><dd>The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.</dd></dl>|true|
28+
|modelNamePrefix|Prefix that will be prepended to all model names.| |OAI|
29+
|optionalProjectFile|Generate client.pri.| |true|
30+
|packageName|C++ package (library) name.| |QtOpenAPIClient|
31+
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
32+
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
33+
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
34+
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
35+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -&gt; Value)| |true|
36+
37+
## IMPORT MAPPING
38+
39+
| Type/Alias | Imports |
40+
| ---------- | ------- |
41+
|OAIHttpFileElement|#include &quot;OAIHttpFileElement.h&quot;|
42+
|QJsonValue|#include &lt;QJsonValue&gt;|
43+
44+
45+
## INSTANTIATION TYPES
46+
47+
| Type/Alias | Instantiated By |
48+
| ---------- | --------------- |
49+
50+
51+
## LANGUAGE PRIMITIVES
52+
53+
<ul class="column-ul">
54+
<li>QByteArray</li>
55+
<li>QDate</li>
56+
<li>QDateTime</li>
57+
<li>QString</li>
58+
<li>bool</li>
59+
<li>double</li>
60+
<li>float</li>
61+
<li>qint32</li>
62+
<li>qint64</li>
63+
</ul>
64+
65+
## RESERVED WORDS
66+
67+
<ul class="column-ul">
68+
<li>alignas</li>
69+
<li>alignof</li>
70+
<li>and</li>
71+
<li>and_eq</li>
72+
<li>asm</li>
73+
<li>auto</li>
74+
<li>bitand</li>
75+
<li>bitor</li>
76+
<li>bool</li>
77+
<li>break</li>
78+
<li>case</li>
79+
<li>catch</li>
80+
<li>char</li>
81+
<li>char16_t</li>
82+
<li>char32_t</li>
83+
<li>class</li>
84+
<li>compl</li>
85+
<li>concept</li>
86+
<li>const</li>
87+
<li>const_cast</li>
88+
<li>constexpr</li>
89+
<li>continue</li>
90+
<li>decltype</li>
91+
<li>default</li>
92+
<li>delete</li>
93+
<li>do</li>
94+
<li>double</li>
95+
<li>dynamic_cast</li>
96+
<li>else</li>
97+
<li>enum</li>
98+
<li>explicit</li>
99+
<li>export</li>
100+
<li>extern</li>
101+
<li>false</li>
102+
<li>float</li>
103+
<li>for</li>
104+
<li>friend</li>
105+
<li>goto</li>
106+
<li>if</li>
107+
<li>inline</li>
108+
<li>int</li>
109+
<li>linux</li>
110+
<li>long</li>
111+
<li>mutable</li>
112+
<li>namespace</li>
113+
<li>new</li>
114+
<li>noexcept</li>
115+
<li>not</li>
116+
<li>not_eq</li>
117+
<li>nullptr</li>
118+
<li>operator</li>
119+
<li>or</li>
120+
<li>or_eq</li>
121+
<li>private</li>
122+
<li>protected</li>
123+
<li>public</li>
124+
<li>register</li>
125+
<li>reinterpret_cast</li>
126+
<li>requires</li>
127+
<li>return</li>
128+
<li>short</li>
129+
<li>signed</li>
130+
<li>sizeof</li>
131+
<li>static</li>
132+
<li>static_assert</li>
133+
<li>static_cast</li>
134+
<li>struct</li>
135+
<li>switch</li>
136+
<li>template</li>
137+
<li>this</li>
138+
<li>thread_local</li>
139+
<li>throw</li>
140+
<li>true</li>
141+
<li>try</li>
142+
<li>typedef</li>
143+
<li>typeid</li>
144+
<li>typename</li>
145+
<li>union</li>
146+
<li>unsigned</li>
147+
<li>using</li>
148+
<li>virtual</li>
149+
<li>void</li>
150+
<li>volatile</li>
151+
<li>wchar_t</li>
152+
<li>while</li>
153+
<li>xor</li>
154+
<li>xor_eq</li>
155+
</ul>
156+
157+
## FEATURE SET
158+
159+
160+
### Client Modification Feature
161+
| Name | Supported | Defined By |
162+
| ---- | --------- | ---------- |
163+
|BasePath|✗|ToolingExtension
164+
|Authorizations|✗|ToolingExtension
165+
|UserAgent|✗|ToolingExtension
166+
|MockServer|✗|ToolingExtension
167+
168+
### Data Type Feature
169+
| Name | Supported | Defined By |
170+
| ---- | --------- | ---------- |
171+
|Custom|✗|OAS2,OAS3
172+
|Int32|✓|OAS2,OAS3
173+
|Int64|✓|OAS2,OAS3
174+
|Float|✓|OAS2,OAS3
175+
|Double|✓|OAS2,OAS3
176+
|Decimal|✓|ToolingExtension
177+
|String|✓|OAS2,OAS3
178+
|Byte|✓|OAS2,OAS3
179+
|Binary|✓|OAS2,OAS3
180+
|Boolean|✓|OAS2,OAS3
181+
|Date|✓|OAS2,OAS3
182+
|DateTime|✓|OAS2,OAS3
183+
|Password|✓|OAS2,OAS3
184+
|File|✓|OAS2
185+
|Uuid||
186+
|Array|✓|OAS2,OAS3
187+
|Null|✗|OAS3
188+
|AnyType|✗|OAS2,OAS3
189+
|Object|✓|OAS2,OAS3
190+
|Maps|✓|ToolingExtension
191+
|CollectionFormat|✓|OAS2
192+
|CollectionFormatMulti|✓|OAS2
193+
|Enum|✓|OAS2,OAS3
194+
|ArrayOfEnum|✓|ToolingExtension
195+
|ArrayOfModel|✓|ToolingExtension
196+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
197+
|ArrayOfCollectionOfModel|✓|ToolingExtension
198+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
199+
|MapOfEnum|✓|ToolingExtension
200+
|MapOfModel|✓|ToolingExtension
201+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
202+
|MapOfCollectionOfModel|✓|ToolingExtension
203+
|MapOfCollectionOfEnum|✓|ToolingExtension
204+
205+
### Documentation Feature
206+
| Name | Supported | Defined By |
207+
| ---- | --------- | ---------- |
208+
|Readme|✓|ToolingExtension
209+
|Model|✓|ToolingExtension
210+
|Api|✓|ToolingExtension
211+
212+
### Global Feature
213+
| Name | Supported | Defined By |
214+
| ---- | --------- | ---------- |
215+
|Host|✓|OAS2,OAS3
216+
|BasePath|✓|OAS2,OAS3
217+
|Info|✓|OAS2,OAS3
218+
|Schemes|✗|OAS2,OAS3
219+
|PartialSchemes|✓|OAS2,OAS3
220+
|Consumes|✓|OAS2
221+
|Produces|✓|OAS2
222+
|ExternalDocumentation|✓|OAS2,OAS3
223+
|Examples|✓|OAS2,OAS3
224+
|XMLStructureDefinitions|✗|OAS2,OAS3
225+
|MultiServer|✓|OAS3
226+
|ParameterizedServer|✓|OAS3
227+
|ParameterStyling|✓|OAS3
228+
|Callbacks|✗|OAS3
229+
|LinkObjects|✗|OAS3
230+
231+
### Parameter Feature
232+
| Name | Supported | Defined By |
233+
| ---- | --------- | ---------- |
234+
|Path|✓|OAS2,OAS3
235+
|Query|✓|OAS2,OAS3
236+
|Header|✓|OAS2,OAS3
237+
|Body|✓|OAS2
238+
|FormUnencoded|✓|OAS2
239+
|FormMultipart|✓|OAS2
240+
|Cookie|✓|OAS3
241+
242+
### Schema Support Feature
243+
| Name | Supported | Defined By |
244+
| ---- | --------- | ---------- |
245+
|Simple|✓|OAS2,OAS3
246+
|Composite|✓|OAS2,OAS3
247+
|Polymorphism|✓|OAS2,OAS3
248+
|Union|✗|OAS3
249+
|allOf|✗|OAS2,OAS3
250+
|anyOf|✗|OAS3
251+
|oneOf|✗|OAS3
252+
|not|✗|OAS3
253+
254+
### Security Feature
255+
| Name | Supported | Defined By |
256+
| ---- | --------- | ---------- |
257+
|BasicAuth|✓|OAS2,OAS3
258+
|ApiKey|✓|OAS2,OAS3
259+
|OpenIDConnect|✗|OAS3
260+
|BearerToken|✓|OAS3
261+
|OAuth2_Implicit|✓|OAS2,OAS3
262+
|OAuth2_Password|✓|OAS2,OAS3
263+
|OAuth2_ClientCredentials|✓|OAS2,OAS3
264+
|OAuth2_AuthorizationCode|✓|OAS2,OAS3
265+
266+
### Wire Format Feature
267+
| Name | Supported | Defined By |
268+
| ---- | --------- | ---------- |
269+
|JSON|✓|OAS2,OAS3
270+
|XML|✓|OAS2,OAS3
271+
|PROTOBUF|✗|ToolingExtension
272+
|Custom|✗|OAS2,OAS3

0 commit comments

Comments
 (0)