forked from loafle/openapi-generator-original
[C++] minor improvements (#5319)
* minor code format, make sure cpp samples updated * add new files
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
@@ -0,0 +1 @@
|
||||
4.3.0-SNAPSHOT
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
#include <QDebug>
|
||||
#include <QJsonParseError>
|
||||
#include "OAIHelpers.h"
|
||||
|
||||
|
||||
@@ -230,6 +231,18 @@ fromStringValue(const QString &inStr, double &value){
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, OAIObject &value)
|
||||
{
|
||||
QJsonParseError err;
|
||||
QJsonDocument::fromJson(inStr.toUtf8(),&err);
|
||||
if ( err.error == QJsonParseError::NoError ){
|
||||
value.fromJson(inStr);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
fromStringValue(const QString &inStr, OAIEnum &value){
|
||||
value.fromJson(inStr);
|
||||
|
||||
Reference in New Issue
Block a user