13 Commits

Author SHA1 Message Date
Mateusz Szychowski (Muttley)
e342513391
[C++][Pistache] Add support for validating arrays, use full namespace type with custom types (#12221)
fixes #11246
2022-05-01 23:53:48 +08:00
Mehmet YUCE
ccd031a3da
Continuing from #1317 and its PRs for pistache server string enum code generation (#9786)
* Continuing from #1317 and its PRs for pistache server string enum code generation;
* A class that has an `anyOf` specification, in cpp side will have no members: in stead it should have a member having the type `classname_anyOf`
* Thus, Its `==` operator is not present or wrongly filled
* An string enum, should have a better usage, hence the `setEnumValue`
* this PR, is a brigde between `stringenumclassname_anyOf` and `stringenumclassname`
* `anyOf` specification is not just about `Enums`, so a better handling is needed from mustache templates, hence new template model parameter `isStringEnumContainer`

* PR fix: muttleyxd: `double semicolon`

* PR fix: wing328: `I think std::string is C++ only. What about adding x-is-string-enum-container instead in the postProcessModel operation in the C++ pistache server generator?`

* PR fix: wing328: `I think std::string is C++ only...` after fix get latest codes and then generate samples

Co-authored-by: Mehmet Fatih <mfyuce@netas.com.tr>
2021-06-20 22:13:38 +08:00
Julian G
8f5639554e
[C++] [Pistache] Model validation, general overhaul (#9251)
* overhaul pistache templates

* fix function signature in model-source
return type now aligns with definition in model-header

* use default keyword for destructors

* generate pistache samples

* move bin/configs/other/cpp-pistache-server-cpp-pistache.yaml to bin/configs/cpp-pistache-server-cpp-pistache.yaml

* Only generate validation body if necessary

* generate pistache samples
2021-05-05 16:52:47 +08:00
Mehmet YUCE
86e418d57b
Fix not processing enums in cpp-pistache-server (#8886)
* Fix not processing enums in cpp-pistache-server

Defining a reusable enum as a component schema results in an empty
class. Following changes are made:

- activate 'postProcessModelsEnum' in 'AbstractCppCodegen'
- modify model templates for the 'cpp-pistache-server' project

As 'postProcessModelsEnum' is now available in the 'AbstactCppCodegen'
the 'enumVars' variables are now available in mustache templates for all
cpp based code generators.

As the 'AbstractCppCodegen' was touched all cpp based
samples were updated.

* fixes encountered on real world

* PR fixes

Co-authored-by: mfyuce <mfyuce@netas.com.tr>
2021-03-09 15:17:25 +08:00
Mateusz Szychowski (Muttley)
f2fe4fc200 [C++][Pistache] Add missing setter for arrays (#3837)
* [C++][Pistache] Add missing setter for arrays

Fixes #3769

* [C++][Pistache] Update Petstore sample
2019-09-07 12:20:04 +02:00
Mateusz Szychowski (Muttley)
c1df082d65 [C++][Pistache] Add compatibility for nlohmann-json 3.5.0 (#3306)
* [C++][Pistache] Replace contains with find on json object

This makes generator compatible with nlohmann-json 3.5.0

* [C++][Pistache] Update Petstore sample
2019-07-13 13:31:14 +02:00
sunn
e85e1f112a
Separate exception types (#2930) 2019-05-18 11:57:23 +02:00
SalDiAngelus
f9d04c9c23 Fixed checking for optional properties when converting from json. (#2779) 2019-05-01 23:18:38 +02:00
SalDiAngelus
89eb603c17 [C++][Pistache] Fixed #2643 (#2653)
* Fixed #2643

Refactored to/from json functions to use universal object serialization method.

* Code review found incorrect indenting and I forgot to remove unused mustache files.

* Removed helpers class because it is not needed anymore.

* Removed helpers package from docs.

* Reverted helper class removal.
2019-04-19 14:00:12 +02:00
sunn
f8f3a08282
[cpp-pistache]Add support for map (#1359)
* Add support for map
* Add support for nested maps
* Simplify Array and Map Helper
* Use const reference wherever possible
2018-11-03 14:09:31 +01:00
sunn
97d6b71460 [cpp-pistache] Fix compilation of petstore for Pistache (#497)
* Fix compilation of petstore for Pistache
Add Map support

* Add support for ByteArray

* Add Support for ByteArray in cpprest

* Implement TODOs
2018-07-20 22:04:25 +08:00
stkrwork
23ab5177b3 [C++][Pistache] Fix optional error and wrong function signatures (#264)
* Added missing includes for optional

* Removed shared pointer from pistache generator

* Changed Net namespace to Pistache Namespace

* Clean up code and removed unnecessary lines in mustache files

* Removed remaining shared pointer syntax

* Code review fixes + updated samples

* Added const to all model setter functions, and reference to all params in setters that are not primitives

* Refactored modelbase

* Removed const

* Updated samples
2018-06-22 09:12:35 +08:00
Akihito Nakano
2392a09eeb [C++ server] Adjust the names (script, sample folder, generator) to lang option (#250)
* Renamce C++ server scripts

* Change output folder

* Rename sample folder: pistache-server -> cpp-pistache

* Rename sample folder: restbed -> cpp-restbed
2018-06-10 22:48:30 +08:00