19 Commits

Author SHA1 Message Date
ppngn
153e1db8a1
[C++][Pistache] Fixes for struct model (#12006)
* [C++][Pistache] fix Wconversion warning

* [C++][Pistache] fix struct model compilation with std::optional

* [C++][Pistache] Add validation to struct model
2022-05-02 00:11:19 +08:00
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
William Cheng
0204bf4ae2 Squashed commit of the following:
commit c5a0d0f7394aa742fa336fff7e7c1d3049761868
Merge: 8c4991ba3ed f8ff8c87609
Author: William Cheng <wing328hk@gmail.com>
Date:   Tue Aug 17 18:28:12 2021 +0800

    Merge branch 'mustache-linting' of https://github.com/NathanBaulch/openapi-generator into NathanBaulch-mustache-linting

commit f8ff8c87609b1ca36fa26fb8474806999638195e
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:12:47 2021 +1000

    Reorder tags that handle missing values

commit f5d8a33709d6a3f846a9fe4520b78c3d637051d9
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:08:59 2021 +1000

    Use dot notation where possible

commit 493d14921e2333f3ae19ef6fc89318b7e263a80c
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 14:10:49 2021 +1000

    Remove empty tags

commit 32480dc53f48227d55531b94e307d72671373737
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Thu Aug 5 10:41:58 2021 +1000

    Remove redundant sections

commit a8edabd722c34aa094b4aeb11c22664529c3a219
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 22:02:22 2021 +1000

    Trim extra EOF new lines

commit e89bd7458e3594bf0d30e580bc9408e45b018a57
Author: Nathan Baulch <nathan.baulch@gmail.com>
Date:   Wed Aug 4 21:59:26 2021 +1000

    Trim trailing whitespace
2021-08-17 18:37:51 +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
3fcbf17536
[C++][Pistache] Fix compile break, error handling (#9742)
* fix compilation break with validate function

* fix error handling in handleParsingException
bug caused all errors to be regarded as an internal server error

* generate samples
2021-06-15 14:42:29 +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
Mateusz Szychowski (Muttley)
68a5fa4c8b [C++][Pistache] Catch exception instead of runtime_error (#3225)
* [C++][Pistache] Replace runtime_error with std::exception

* [C++][Pistache] Update Petstore sample

* [C++][Pistache] Fix catch-value warning
2019-06-26 19:13:54 +02:00
Matthias Preu
1eca97f738 Fix wrong include path in api-header template (#3062)
Change local json.hpp include path to correct value.

Update samples.
2019-06-03 15:41:45 +08: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
3d4c3c545b
[c++ pistache server] Support basic query handling (#943)
Support basic query handling

Add  helpers for primitive de-serialization
Remove warnings due to unneeded commas
Deserialize basic types in queries
Add dependencies chain for external libraries
Fixes wrong parameter passed to API
2018-09-12 09:53:01 +02: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