Skip to content

Commit 5b8a115

Browse files
authored
[C++] [Client] Added cpp-oatpp-client (#21711)
* Added cpp-oatpp-client. * Updated pipelines. * Should match formatting now. * Moved includes around. * Ran doc generator.
1 parent 603dbfd commit 5b8a115

File tree

32 files changed

+2573
-1
lines changed

32 files changed

+2573
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Samples cpp oat++ client
2+
3+
on:
4+
push:
5+
branches:
6+
- "samples/client/petstore/cpp-oatpp/**"
7+
pull_request:
8+
paths:
9+
- "samples/client/petstore/cpp-oatpp/**"
10+
11+
env:
12+
GRADLE_VERSION: 6.9
13+
14+
jobs:
15+
build:
16+
name: Build cpp oat++ client
17+
strategy:
18+
matrix:
19+
sample:
20+
- samples/client/petstore/cpp-oatpp
21+
os:
22+
- ubuntu-latest
23+
- macOS-latest
24+
- windows-latest
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Build
29+
working-directory: ${{ matrix.sample }}
30+
run: cmake -B build && cmake --build build --verbose

.github/workflows/samples-cpp-oatpp-server.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313

1414
jobs:
1515
build:
16-
name: Build cpp qt client
16+
name: Build cpp oat++ server
1717
strategy:
1818
matrix:
1919
sample:

.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)

docs/generators/cpp-oatpp-client.md

Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
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++ API client (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+
|addExternalLibs|Add the Possibility to fetch and compile external Libraries needed by this Framework.| |true|
22+
|reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_|
23+
|variableNameFirstCharacterUppercase|Make first character of variable name uppercase (eg. value -> Value)| |true|
24+
25+
## IMPORT MAPPING
26+
27+
| Type/Alias | Imports |
28+
| ---------- | ------- |
29+
30+
31+
## INSTANTIATION TYPES
32+
33+
| Type/Alias | Instantiated By |
34+
| ---------- | --------------- |
35+
36+
37+
## LANGUAGE PRIMITIVES
38+
39+
<ul class="column-ul">
40+
<li>oatpp::Any</li>
41+
<li>oatpp::Boolean</li>
42+
<li>oatpp::Fields</li>
43+
<li>oatpp::Float64</li>
44+
<li>oatpp::Int32</li>
45+
<li>oatpp::Int64</li>
46+
<li>oatpp::Object</li>
47+
<li>oatpp::String</li>
48+
<li>oatpp::UnorderedSet</li>
49+
<li>oatpp::Vector</li>
50+
</ul>
51+
52+
## RESERVED WORDS
53+
54+
<ul class="column-ul">
55+
<li>NULL</li>
56+
<li>alignas</li>
57+
<li>alignof</li>
58+
<li>and</li>
59+
<li>and_eq</li>
60+
<li>asm</li>
61+
<li>auto</li>
62+
<li>bitand</li>
63+
<li>bitor</li>
64+
<li>bool</li>
65+
<li>break</li>
66+
<li>case</li>
67+
<li>catch</li>
68+
<li>char</li>
69+
<li>char16_t</li>
70+
<li>char32_t</li>
71+
<li>class</li>
72+
<li>compl</li>
73+
<li>concept</li>
74+
<li>const</li>
75+
<li>const_cast</li>
76+
<li>constexpr</li>
77+
<li>continue</li>
78+
<li>decltype</li>
79+
<li>default</li>
80+
<li>delete</li>
81+
<li>do</li>
82+
<li>double</li>
83+
<li>dynamic_cast</li>
84+
<li>else</li>
85+
<li>enum</li>
86+
<li>explicit</li>
87+
<li>export</li>
88+
<li>extern</li>
89+
<li>false</li>
90+
<li>float</li>
91+
<li>for</li>
92+
<li>friend</li>
93+
<li>goto</li>
94+
<li>if</li>
95+
<li>inline</li>
96+
<li>int</li>
97+
<li>linux</li>
98+
<li>long</li>
99+
<li>mutable</li>
100+
<li>namespace</li>
101+
<li>new</li>
102+
<li>noexcept</li>
103+
<li>not</li>
104+
<li>not_eq</li>
105+
<li>nullptr</li>
106+
<li>operator</li>
107+
<li>or</li>
108+
<li>or_eq</li>
109+
<li>private</li>
110+
<li>protected</li>
111+
<li>public</li>
112+
<li>register</li>
113+
<li>reinterpret_cast</li>
114+
<li>requires</li>
115+
<li>return</li>
116+
<li>short</li>
117+
<li>signed</li>
118+
<li>sizeof</li>
119+
<li>static</li>
120+
<li>static_assert</li>
121+
<li>static_cast</li>
122+
<li>struct</li>
123+
<li>switch</li>
124+
<li>template</li>
125+
<li>this</li>
126+
<li>thread_local</li>
127+
<li>throw</li>
128+
<li>true</li>
129+
<li>try</li>
130+
<li>typedef</li>
131+
<li>typeid</li>
132+
<li>typename</li>
133+
<li>union</li>
134+
<li>unsigned</li>
135+
<li>using</li>
136+
<li>virtual</li>
137+
<li>void</li>
138+
<li>volatile</li>
139+
<li>wchar_t</li>
140+
<li>while</li>
141+
<li>xor</li>
142+
<li>xor_eq</li>
143+
</ul>
144+
145+
## FEATURE SET
146+
147+
148+
### Client Modification Feature
149+
| Name | Supported | Defined By |
150+
| ---- | --------- | ---------- |
151+
|BasePath|✗|ToolingExtension
152+
|Authorizations|✗|ToolingExtension
153+
|UserAgent|✗|ToolingExtension
154+
|MockServer|✗|ToolingExtension
155+
156+
### Data Type Feature
157+
| Name | Supported | Defined By |
158+
| ---- | --------- | ---------- |
159+
|Custom|✗|OAS2,OAS3
160+
|Int32|✓|OAS2,OAS3
161+
|Int64|✓|OAS2,OAS3
162+
|Float|✓|OAS2,OAS3
163+
|Double|✓|OAS2,OAS3
164+
|Decimal|✓|ToolingExtension
165+
|String|✓|OAS2,OAS3
166+
|Byte|✓|OAS2,OAS3
167+
|Binary|✓|OAS2,OAS3
168+
|Boolean|✓|OAS2,OAS3
169+
|Date|✓|OAS2,OAS3
170+
|DateTime|✓|OAS2,OAS3
171+
|Password|✓|OAS2,OAS3
172+
|File|✓|OAS2
173+
|Uuid||
174+
|Array|✓|OAS2,OAS3
175+
|Null|✗|OAS3
176+
|AnyType|✗|OAS2,OAS3
177+
|Object|✓|OAS2,OAS3
178+
|Maps|✓|ToolingExtension
179+
|CollectionFormat|✓|OAS2
180+
|CollectionFormatMulti|✓|OAS2
181+
|Enum|✓|OAS2,OAS3
182+
|ArrayOfEnum|✓|ToolingExtension
183+
|ArrayOfModel|✓|ToolingExtension
184+
|ArrayOfCollectionOfPrimitives|✓|ToolingExtension
185+
|ArrayOfCollectionOfModel|✓|ToolingExtension
186+
|ArrayOfCollectionOfEnum|✓|ToolingExtension
187+
|MapOfEnum|✓|ToolingExtension
188+
|MapOfModel|✓|ToolingExtension
189+
|MapOfCollectionOfPrimitives|✓|ToolingExtension
190+
|MapOfCollectionOfModel|✓|ToolingExtension
191+
|MapOfCollectionOfEnum|✓|ToolingExtension
192+
193+
### Documentation Feature
194+
| Name | Supported | Defined By |
195+
| ---- | --------- | ---------- |
196+
|Readme|✓|ToolingExtension
197+
|Model|✓|ToolingExtension
198+
|Api|✓|ToolingExtension
199+
200+
### Global Feature
201+
| Name | Supported | Defined By |
202+
| ---- | --------- | ---------- |
203+
|Host|✓|OAS2,OAS3
204+
|BasePath|✓|OAS2,OAS3
205+
|Info|✓|OAS2,OAS3
206+
|Schemes|✗|OAS2,OAS3
207+
|PartialSchemes|✓|OAS2,OAS3
208+
|Consumes|✓|OAS2
209+
|Produces|✓|OAS2
210+
|ExternalDocumentation|✓|OAS2,OAS3
211+
|Examples|✓|OAS2,OAS3
212+
|XMLStructureDefinitions|✗|OAS2,OAS3
213+
|MultiServer|✗|OAS3
214+
|ParameterizedServer|✗|OAS3
215+
|ParameterStyling|✗|OAS3
216+
|Callbacks|✗|OAS3
217+
|LinkObjects|✗|OAS3
218+
219+
### Parameter Feature
220+
| Name | Supported | Defined By |
221+
| ---- | --------- | ---------- |
222+
|Path|✓|OAS2,OAS3
223+
|Query|✓|OAS2,OAS3
224+
|Header|✓|OAS2,OAS3
225+
|Body|✓|OAS2
226+
|FormUnencoded|✓|OAS2
227+
|FormMultipart|✓|OAS2
228+
|Cookie|✗|OAS3
229+
230+
### Schema Support Feature
231+
| Name | Supported | Defined By |
232+
| ---- | --------- | ---------- |
233+
|Simple|✓|OAS2,OAS3
234+
|Composite|✓|OAS2,OAS3
235+
|Polymorphism|✗|OAS2,OAS3
236+
|Union|✗|OAS3
237+
|allOf|✗|OAS2,OAS3
238+
|anyOf|✗|OAS3
239+
|oneOf|✗|OAS3
240+
|not|✗|OAS3
241+
242+
### Security Feature
243+
| Name | Supported | Defined By |
244+
| ---- | --------- | ---------- |
245+
|BasicAuth|✗|OAS2,OAS3
246+
|ApiKey|✗|OAS2,OAS3
247+
|OpenIDConnect|✗|OAS3
248+
|BearerToken|✗|OAS3
249+
|OAuth2_Implicit|✗|OAS2,OAS3
250+
|OAuth2_Password|✗|OAS2,OAS3
251+
|OAuth2_ClientCredentials|✗|OAS2,OAS3
252+
|OAuth2_AuthorizationCode|✗|OAS2,OAS3
253+
|SignatureAuth|✗|OAS3
254+
|AWSV4Signature|✗|ToolingExtension
255+
256+
### Wire Format Feature
257+
| Name | Supported | Defined By |
258+
| ---- | --------- | ---------- |
259+
|JSON|✓|OAS2,OAS3
260+
|XML|✓|OAS2,OAS3
261+
|PROTOBUF|✗|ToolingExtension
262+
|Custom|✗|OAS2,OAS3

0 commit comments

Comments
 (0)