forked from loafle/openapi-generator-original
[C++] Rename Qt5 to Qt (#9490)
* rename qt5 to qt * rename, update * rename qt5 to qt in the templates * update doc
This commit is contained in:
parent
55b95bc9c5
commit
9e4afb0fc3
@ -1,7 +1,7 @@
|
|||||||
generatorName: cpp-qt5-client
|
generatorName: cpp-qt-client
|
||||||
outputDir: samples/client/petstore/cpp-qt5
|
outputDir: samples/client/petstore/cpp-qt
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-client
|
templateDir: modules/openapi-generator/src/main/resources/cpp-qt-client
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
cppNamespace: test_namespace
|
cppNamespace: test_namespace
|
||||||
modelNamePrefix: PFX
|
modelNamePrefix: PFX
|
@ -1,4 +1,4 @@
|
|||||||
generatorName: cpp-qt5-qhttpengine-server
|
generatorName: cpp-qt-qhttpengine-server
|
||||||
outputDir: samples/server/petstore/cpp-qt5-qhttpengine-server
|
outputDir: samples/server/petstore/cpp-qt-qhttpengine-server
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server
|
templateDir: modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server
|
@ -12,7 +12,7 @@ The following generators are available:
|
|||||||
* [bash](generators/bash.md)
|
* [bash](generators/bash.md)
|
||||||
* [c](generators/c.md)
|
* [c](generators/c.md)
|
||||||
* [clojure](generators/clojure.md)
|
* [clojure](generators/clojure.md)
|
||||||
* [cpp-qt5-client](generators/cpp-qt5-client.md)
|
* [cpp-qt-client](generators/cpp-qt-client.md)
|
||||||
* [cpp-restsdk](generators/cpp-restsdk.md)
|
* [cpp-restsdk](generators/cpp-restsdk.md)
|
||||||
* [cpp-tizen](generators/cpp-tizen.md)
|
* [cpp-tizen](generators/cpp-tizen.md)
|
||||||
* [cpp-ue4 (beta)](generators/cpp-ue4.md)
|
* [cpp-ue4 (beta)](generators/cpp-ue4.md)
|
||||||
@ -80,7 +80,7 @@ The following generators are available:
|
|||||||
* [ada-server](generators/ada-server.md)
|
* [ada-server](generators/ada-server.md)
|
||||||
* [aspnetcore](generators/aspnetcore.md)
|
* [aspnetcore](generators/aspnetcore.md)
|
||||||
* [cpp-pistache-server](generators/cpp-pistache-server.md)
|
* [cpp-pistache-server](generators/cpp-pistache-server.md)
|
||||||
* [cpp-qt5-qhttpengine-server](generators/cpp-qt5-qhttpengine-server.md)
|
* [cpp-qt-qhttpengine-server](generators/cpp-qt-qhttpengine-server.md)
|
||||||
* [cpp-restbed-server](generators/cpp-restbed-server.md)
|
* [cpp-restbed-server](generators/cpp-restbed-server.md)
|
||||||
* [csharp-nancyfx](generators/csharp-nancyfx.md)
|
* [csharp-nancyfx](generators/csharp-nancyfx.md)
|
||||||
* [erlang-server](generators/erlang-server.md)
|
* [erlang-server](generators/erlang-server.md)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Config Options for cpp-qt5-client
|
title: Config Options for cpp-qt-client
|
||||||
sidebar_label: cpp-qt5-client
|
sidebar_label: cpp-qt-client
|
||||||
---
|
---
|
||||||
|
|
||||||
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.
|
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.
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Config Options for cpp-qt5-qhttpengine-server
|
title: Config Options for cpp-qt-qhttpengine-server
|
||||||
sidebar_label: cpp-qt5-qhttpengine-server
|
sidebar_label: cpp-qt-qhttpengine-server
|
||||||
---
|
---
|
||||||
|
|
||||||
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.
|
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.
|
@ -13,8 +13,8 @@ import org.slf4j.LoggerFactory;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class CppQt5AbstractCodegen extends AbstractCppCodegen implements CodegenConfig {
|
public class CppQtAbstractCodegen extends AbstractCppCodegen implements CodegenConfig {
|
||||||
private final Logger LOGGER = LoggerFactory.getLogger(CppQt5AbstractCodegen.class);
|
private final Logger LOGGER = LoggerFactory.getLogger(CppQtAbstractCodegen.class);
|
||||||
protected final String PREFIX = "OAI";
|
protected final String PREFIX = "OAI";
|
||||||
protected String apiVersion = "1.0.0";
|
protected String apiVersion = "1.0.0";
|
||||||
protected static final String CPP_NAMESPACE = "cppNamespace";
|
protected static final String CPP_NAMESPACE = "cppNamespace";
|
||||||
@ -29,7 +29,7 @@ public class CppQt5AbstractCodegen extends AbstractCppCodegen implements Codegen
|
|||||||
|
|
||||||
protected Set<String> nonFrameworkPrimitives = new HashSet<String>();
|
protected Set<String> nonFrameworkPrimitives = new HashSet<String>();
|
||||||
|
|
||||||
public CppQt5AbstractCodegen() {
|
public CppQtAbstractCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
modifyFeatureSet(features -> features
|
modifyFeatureSet(features -> features
|
@ -29,28 +29,28 @@ import java.io.File;
|
|||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.*;
|
import static org.openapitools.codegen.utils.StringUtils.*;
|
||||||
|
|
||||||
public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements CodegenConfig {
|
public class CppQtClientCodegen extends CppQtAbstractCodegen implements CodegenConfig {
|
||||||
public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate client.pri.";
|
public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate client.pri.";
|
||||||
// source folder where to write the files
|
// source folder where to write the files
|
||||||
protected String sourceFolder = "client";
|
protected String sourceFolder = "client";
|
||||||
protected boolean optionalProjectFileFlag = true;
|
protected boolean optionalProjectFileFlag = true;
|
||||||
|
|
||||||
public CppQt5ClientCodegen() {
|
public CppQtClientCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|
||||||
modifyFeatureSet(features -> features
|
modifyFeatureSet(features -> features
|
||||||
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
.includeDocumentationFeatures(DocumentationFeature.Readme)
|
||||||
.includeGlobalFeatures(GlobalFeature.ParameterizedServer)
|
.includeGlobalFeatures(GlobalFeature.ParameterizedServer)
|
||||||
.includeGlobalFeatures(GlobalFeature.MultiServer)
|
.includeGlobalFeatures(GlobalFeature.MultiServer)
|
||||||
.includeSecurityFeatures(SecurityFeature.BasicAuth)
|
.includeSecurityFeatures(SecurityFeature.BasicAuth)
|
||||||
.includeSecurityFeatures(SecurityFeature.ApiKey)
|
.includeSecurityFeatures(SecurityFeature.ApiKey)
|
||||||
.includeSecurityFeatures(SecurityFeature.BearerToken)
|
.includeSecurityFeatures(SecurityFeature.BearerToken)
|
||||||
.includeGlobalFeatures(GlobalFeature.ParameterStyling)
|
.includeGlobalFeatures(GlobalFeature.ParameterStyling)
|
||||||
);
|
);
|
||||||
|
|
||||||
// set the output folder here
|
// set the output folder here
|
||||||
outputFolder = "generated-code/qt5cpp";
|
outputFolder = "generated-code/cpp-qt-client";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Models. You can write model files using the modelTemplateFiles map.
|
* Models. You can write model files using the modelTemplateFiles map.
|
||||||
@ -83,7 +83,7 @@ public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements Codege
|
|||||||
* Template Location. This is the location which templates will be read from. The generator
|
* Template Location. This is the location which templates will be read from. The generator
|
||||||
* will use the resource stream to attempt to read the templates.
|
* will use the resource stream to attempt to read the templates.
|
||||||
*/
|
*/
|
||||||
embeddedTemplateDir = templateDir = "cpp-qt5-client";
|
embeddedTemplateDir = templateDir = "cpp-qt-client";
|
||||||
|
|
||||||
addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, this.optionalProjectFileFlag);
|
addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, this.optionalProjectFileFlag);
|
||||||
supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, PREFIX + "Helpers.h"));
|
supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder, PREFIX + "Helpers.h"));
|
||||||
@ -94,9 +94,9 @@ public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements Codege
|
|||||||
supportingFiles.add(new SupportingFile("HttpFileElement.cpp.mustache", sourceFolder, PREFIX + "HttpFileElement.cpp"));
|
supportingFiles.add(new SupportingFile("HttpFileElement.cpp.mustache", sourceFolder, PREFIX + "HttpFileElement.cpp"));
|
||||||
supportingFiles.add(new SupportingFile("object.mustache", sourceFolder, PREFIX + "Object.h"));
|
supportingFiles.add(new SupportingFile("object.mustache", sourceFolder, PREFIX + "Object.h"));
|
||||||
supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, PREFIX + "Enum.h"));
|
supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, PREFIX + "Enum.h"));
|
||||||
supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", sourceFolder, PREFIX +"ServerConfiguration.h"));
|
supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", sourceFolder, PREFIX + "ServerConfiguration.h"));
|
||||||
supportingFiles.add(new SupportingFile("ServerVariable.mustache", sourceFolder, PREFIX +"ServerVariable.h"));
|
supportingFiles.add(new SupportingFile("ServerVariable.mustache", sourceFolder, PREFIX + "ServerVariable.h"));
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", "","README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt"));
|
supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt"));
|
||||||
if (optionalProjectFileFlag) {
|
if (optionalProjectFileFlag) {
|
||||||
supportingFiles.add(new SupportingFile("Project.mustache", sourceFolder, "client.pri"));
|
supportingFiles.add(new SupportingFile("Project.mustache", sourceFolder, "client.pri"));
|
||||||
@ -127,7 +127,7 @@ public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements Codege
|
|||||||
supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, modelNamePrefix + "Enum.h"));
|
supportingFiles.add(new SupportingFile("enum.mustache", sourceFolder, modelNamePrefix + "Enum.h"));
|
||||||
supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", sourceFolder, modelNamePrefix + "ServerConfiguration.h"));
|
supportingFiles.add(new SupportingFile("ServerConfiguration.mustache", sourceFolder, modelNamePrefix + "ServerConfiguration.h"));
|
||||||
supportingFiles.add(new SupportingFile("ServerVariable.mustache", sourceFolder, modelNamePrefix + "ServerVariable.h"));
|
supportingFiles.add(new SupportingFile("ServerVariable.mustache", sourceFolder, modelNamePrefix + "ServerVariable.h"));
|
||||||
supportingFiles.add(new SupportingFile("README.mustache", "","README.md"));
|
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
|
||||||
supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt"));
|
supportingFiles.add(new SupportingFile("CMakeLists.txt.mustache", sourceFolder, "CMakeLists.txt"));
|
||||||
|
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements Codege
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "cpp-qt5-client";
|
return "cpp-qt-client";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -169,7 +169,7 @@ public class CppQt5ClientCodegen extends CppQt5AbstractCodegen implements Codege
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a Qt5 C++ client library.";
|
return "Generates a Qt C++ client library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@ -26,7 +26,7 @@ import java.io.File;
|
|||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
|
|
||||||
public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implements CodegenConfig {
|
public class CppQtQHttpEngineServerCodegen extends CppQtAbstractCodegen implements CodegenConfig {
|
||||||
|
|
||||||
protected final String SRC_DIR = "/src";
|
protected final String SRC_DIR = "/src";
|
||||||
protected final String MODEL_DIR = "/src/models";
|
protected final String MODEL_DIR = "/src/models";
|
||||||
@ -36,13 +36,13 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
|
|||||||
// source folder where to write the files
|
// source folder where to write the files
|
||||||
protected String sourceFolder = "server";
|
protected String sourceFolder = "server";
|
||||||
|
|
||||||
public CppQt5QHttpEngineServerCodegen() {
|
public CppQtQHttpEngineServerCodegen() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
|
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
|
||||||
|
|
||||||
// set the output folder here
|
// set the output folder here
|
||||||
outputFolder = "generated-code/cpp-qt5-qhttpengine-server";
|
outputFolder = "generated-code/cpp-qt-qhttpengine-server";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Models. You can write model files using the modelTemplateFiles map.
|
* Models. You can write model files using the modelTemplateFiles map.
|
||||||
@ -83,7 +83,7 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
|
|||||||
* Template Location. This is the location which templates will be read from. The generator
|
* Template Location. This is the location which templates will be read from. The generator
|
||||||
* will use the resource stream to attempt to read the templates.
|
* will use the resource stream to attempt to read the templates.
|
||||||
*/
|
*/
|
||||||
embeddedTemplateDir = templateDir = "cpp-qt5-qhttpengine-server";
|
embeddedTemplateDir = templateDir = "cpp-qt-qhttpengine-server";
|
||||||
|
|
||||||
supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder + MODEL_DIR, PREFIX + "Helpers.h"));
|
supportingFiles.add(new SupportingFile("helpers-header.mustache", sourceFolder + MODEL_DIR, PREFIX + "Helpers.h"));
|
||||||
supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder + MODEL_DIR, PREFIX + "Helpers.cpp"));
|
supportingFiles.add(new SupportingFile("helpers-body.mustache", sourceFolder + MODEL_DIR, PREFIX + "Helpers.cpp"));
|
||||||
@ -154,7 +154,7 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "cpp-qt5-qhttpengine-server";
|
return "cpp-qt-qhttpengine-server";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,7 +165,7 @@ public class CppQt5QHttpEngineServerCodegen extends CppQt5AbstractCodegen implem
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getHelp() {
|
public String getHelp() {
|
||||||
return "Generates a Qt5 C++ Server using the QHTTPEngine HTTP Library.";
|
return "Generates a Qt C++ Server using the QHTTPEngine HTTP Library.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@ -11,8 +11,8 @@ org.openapitools.codegen.languages.CrystalClientCodegen
|
|||||||
org.openapitools.codegen.languages.CLibcurlClientCodegen
|
org.openapitools.codegen.languages.CLibcurlClientCodegen
|
||||||
org.openapitools.codegen.languages.ClojureClientCodegen
|
org.openapitools.codegen.languages.ClojureClientCodegen
|
||||||
org.openapitools.codegen.languages.ConfluenceWikiCodegen
|
org.openapitools.codegen.languages.ConfluenceWikiCodegen
|
||||||
org.openapitools.codegen.languages.CppQt5ClientCodegen
|
org.openapitools.codegen.languages.CppQtClientCodegen
|
||||||
org.openapitools.codegen.languages.CppQt5QHttpEngineServerCodegen
|
org.openapitools.codegen.languages.CppQtQHttpEngineServerCodegen
|
||||||
org.openapitools.codegen.languages.CppPistacheServerCodegen
|
org.openapitools.codegen.languages.CppPistacheServerCodegen
|
||||||
org.openapitools.codegen.languages.CppRestbedServerCodegen
|
org.openapitools.codegen.languages.CppRestbedServerCodegen
|
||||||
org.openapitools.codegen.languages.CppRestSdkClientCodegen
|
org.openapitools.codegen.languages.CppRestSdkClientCodegen
|
||||||
|
@ -328,7 +328,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) {
|
|||||||
if ({{prefix}}HttpRequestWorker::sslDefaultConfiguration != nullptr) {
|
if ({{prefix}}HttpRequestWorker::sslDefaultConfiguration != nullptr) {
|
||||||
request.setSslConfiguration(*{{prefix}}HttpRequestWorker::sslDefaultConfiguration);
|
request.setSslConfiguration(*{{prefix}}HttpRequestWorker::sslDefaultConfiguration);
|
||||||
}
|
}
|
||||||
request.setRawHeader("User-Agent", "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{apiVersion}}/cpp-qt5{{/httpUserAgent}}");
|
request.setRawHeader("User-Agent", "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{apiVersion}}/cpp-qt{{/httpUserAgent}}");
|
||||||
foreach (QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); }
|
foreach (QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); }
|
||||||
|
|
||||||
if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) {
|
if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) {
|
@ -53,10 +53,10 @@ At first generate the JAR by executing:
|
|||||||
mvn clean package
|
mvn clean package
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the Jar file to generate the Qt5 Client:
|
Use the Jar file to generate the Qt Client:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
java -jar target/openapi-generator-cli.jar generate -i <yourOpenApiFile> -g cpp-qt5-client -o <outputDir>
|
java -jar target/openapi-generator-cli.jar generate -i <yourOpenApiFile> -g cpp-qt-client -o <outputDir>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
@ -1,5 +1,5 @@
|
|||||||
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
|
||||||
project(cpp-qt5-qhttpengine-server)
|
project(cpp-qt-qhttpengine-server)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
@ -23,7 +23,7 @@ RUN apk add --update \
|
|||||||
openssl
|
openssl
|
||||||
|
|
||||||
WORKDIR /usr/server
|
WORKDIR /usr/server
|
||||||
COPY --from=build /usr/server/build/src/cpp-qt5-qhttpengine-server ./build/src/
|
COPY --from=build /usr/server/build/src/cpp-qt-qhttpengine-server ./build/src/
|
||||||
COPY --from=build /usr/server/external/ ./external
|
COPY --from=build /usr/server/external/ ./external
|
||||||
EXPOSE 8080/tcp
|
EXPOSE 8080/tcp
|
||||||
ENTRYPOINT ["/usr/server/build/src/cpp-qt5-qhttpengine-server"]
|
ENTRYPOINT ["/usr/server/build/src/cpp-qt-qhttpengine-server"]
|
@ -1,6 +1,6 @@
|
|||||||
# C++ Qt5 Server
|
# C++ Qt Server
|
||||||
|
|
||||||
## Qt5 HTTP Server based on the Qhttpengine
|
## Qt HTTP Server based on the Qhttpengine
|
||||||
|
|
||||||
This server was generated by the [openapi-generator](https://openapi-generator.tech) project.
|
This server was generated by the [openapi-generator](https://openapi-generator.tech) project.
|
||||||
By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub.
|
By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub.
|
||||||
@ -50,18 +50,18 @@ make
|
|||||||
To run the server
|
To run the server
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
./build/src/cpp-qt5-qhttpengine-server &
|
./build/src/cpp-qt-qhttpengine-server &
|
||||||
```
|
```
|
||||||
|
|
||||||
To override the default port via the command line, provide the parameters `port` and `address` like below
|
To override the default port via the command line, provide the parameters `port` and `address` like below
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cpp-qt5-qhttpengine-server --port 9080 --address 127.17.0.1
|
cpp-qt-qhttpengine-server --port 9080 --address 127.17.0.1
|
||||||
```
|
```
|
||||||
or
|
or
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cpp-qt5-qhttpengine-server -p 9080 -a 127.17.0.1
|
cpp-qt-qhttpengine-server -p 9080 -a 127.17.0.1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Invoke an API
|
#### Invoke an API
|
||||||
@ -80,13 +80,13 @@ If you dont have docker install [here](https://docs.docker.com/install)
|
|||||||
Add yourself to the docker group
|
Add yourself to the docker group
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker build --network=host -t cpp-qt5-qhttpengine-server .
|
docker build --network=host -t cpp-qt-qhttpengine-server .
|
||||||
```
|
```
|
||||||
|
|
||||||
Running with docker
|
Running with docker
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker run --rm -it --name=server-container cpp-qt5-qhttpengine-server
|
docker run --rm -it --name=server-container cpp-qt-qhttpengine-server
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Invoking an API
|
#### Invoking an API
|
2
pom.xml
2
pom.xml
@ -1201,7 +1201,7 @@
|
|||||||
<!-- comment out as it's not working as the momment
|
<!-- comment out as it's not working as the momment
|
||||||
<module>samples/client/petstore/c</module>
|
<module>samples/client/petstore/c</module>
|
||||||
-->
|
-->
|
||||||
<module>samples/client/petstore/cpp-qt5</module>
|
<module>samples/client/petstore/cpp-qt</module>
|
||||||
<module>samples/client/petstore/rust</module>
|
<module>samples/client/petstore/rust</module>
|
||||||
<module>samples/client/petstore/rust/reqwest/petstore</module>
|
<module>samples/client/petstore/rust/reqwest/petstore</module>
|
||||||
<module>samples/client/petstore/rust/reqwest/petstore-async</module>
|
<module>samples/client/petstore/rust/reqwest/petstore-async</module>
|
||||||
|
@ -46,10 +46,10 @@ At first generate the JAR by executing:
|
|||||||
mvn clean package
|
mvn clean package
|
||||||
```
|
```
|
||||||
|
|
||||||
Use the Jar file to generate the Qt5 Client:
|
Use the Jar file to generate the Qt Client:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
java -jar target/openapi-generator-cli.jar generate -i <yourOpenApiFile> -g cpp-qt5-client -o <outputDir>
|
java -jar target/openapi-generator-cli.jar generate -i <yourOpenApiFile> -g cpp-qt-client -o <outputDir>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
@ -335,7 +335,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) {
|
|||||||
if (PFXHttpRequestWorker::sslDefaultConfiguration != nullptr) {
|
if (PFXHttpRequestWorker::sslDefaultConfiguration != nullptr) {
|
||||||
request.setSslConfiguration(*PFXHttpRequestWorker::sslDefaultConfiguration);
|
request.setSslConfiguration(*PFXHttpRequestWorker::sslDefaultConfiguration);
|
||||||
}
|
}
|
||||||
request.setRawHeader("User-Agent", "OpenAPI-Generator/1.0.0/cpp-qt5");
|
request.setRawHeader("User-Agent", "OpenAPI-Generator/1.0.0/cpp-qt");
|
||||||
foreach (QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); }
|
foreach (QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); }
|
||||||
|
|
||||||
if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) {
|
if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user