mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 02:25:20 +00:00
[C++] [cpprestsdk] Add examples and test for cpprestsdk (#3109)
Add examples and test for cpprestsdk
This commit is contained in:
parent
3df525ee33
commit
6c98046ee6
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-rest-sdk-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-rest-sdk-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-restsdk -o samples/client/petstore/cpp-restsdk/client $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-restsdk -o samples\client\petstore\cpp-restsdk
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-restsdk -o samples\client\petstore\cpp-restsdk\client
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
@ -1,54 +1,37 @@
|
||||
#
|
||||
# OpenAPI Petstore
|
||||
# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#
|
||||
# OpenAPI spec version: 1.0.0
|
||||
#
|
||||
# https://openapi-generator.tech
|
||||
#
|
||||
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
cmake_minimum_required (VERSION 3.2)
|
||||
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
#PROJECT's NAME
|
||||
project(CppRestOpenAPIClient)
|
||||
project(cpprest-petstore)
|
||||
set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
|
||||
# THE LOCATION OF OUTPUT BINARIES
|
||||
set(CMAKE_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_DIR})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Wno-unused-variable")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++14 -Wall -Wno-unused-variable")
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -g3")
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_PREFIX_PATH /usr/lib/x86_64-linux-gnu/cmake)
|
||||
find_package(cpprestsdk REQUIRED)
|
||||
find_package(Boost REQUIRED)
|
||||
add_subdirectory(client)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
file(GLOB SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
|
||||
)
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/client
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/client/model
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/client/api
|
||||
)
|
||||
|
||||
# BUILD TYPE
|
||||
message("A ${CMAKE_BUILD_TYPE} build configuration is detected")
|
||||
link_directories(
|
||||
${Boost_LIBRARY_DIRS}
|
||||
)
|
||||
add_executable(${PROJECT_NAME} ${SRCS})
|
||||
add_dependencies(${PROJECT_NAME} CppRestOpenAPIClient )
|
||||
target_link_libraries(${PROJECT_NAME} CppRestOpenAPIClient cpprest pthread boost_system crypto)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
|
||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Update require components as necessary
|
||||
#find_package(Boost 1.45.0 REQUIRED COMPONENTS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
|
||||
|
||||
# build and set path to cpp rest sdk
|
||||
set(CPPREST_ROOT ${PROJECT_SOURCE_DIR}/3rdParty/cpprest)
|
||||
set(CPPREST_INCLUDE_DIR ${CPPREST_ROOT}/include)
|
||||
set(CPPREST_LIBRARY_DIR ${CPPREST_ROOT}/lib)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR} api model ${CPPREST_INCLUDE_DIR})
|
||||
|
||||
|
||||
# If using vcpkg, set include directories. Also comment out CPPREST section above since vcpkg will handle it.
|
||||
# To install required vcpkg packages execute:
|
||||
# > vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows
|
||||
# set(VCPKG_ROOT "C:\\vcpkg\\installed\\x64-windows")
|
||||
# set(VCPKG_INCLUDE_DIR ${VCPKG_ROOT}/include)
|
||||
# set(VCPKG_LIBRARY_DIR ${VCPKG_ROOT}/lib)
|
||||
# include_directories(${PROJECT_SOURCE_DIR} api model ${VCPKG_INCLUDE_DIR})
|
||||
|
||||
#SUPPORTING FILES
|
||||
set(SUPPORTING_FILES "ApiClient" "ApiConfiguration" "ApiException" "HttpContent" "IHttpBody" "JsonBody" "ModelBase" "MultipartFormData" "Object")
|
||||
#SOURCE FILES
|
||||
file(GLOB SOURCE_FILES "api/*" "model/*")
|
||||
|
||||
add_library(${PROJECT_NAME} ${SUPPORTING_FILES} ${SOURCE_FILES})
|
||||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
||||
|
92
samples/client/petstore/cpp-restsdk/PetApiTests.cpp
Normal file
92
samples/client/petstore/cpp-restsdk/PetApiTests.cpp
Normal file
@ -0,0 +1,92 @@
|
||||
#include "PetApiTests.h"
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
|
||||
OAIPetApiTests::OAIPetApiTests(std::string host, std::string basePath){
|
||||
apiconfiguration = std::make_shared<ApiConfiguration>();
|
||||
apiconfiguration->setBaseUrl(host + basePath);
|
||||
apiconfiguration->setUserAgent(U("OpenAPI Client"));
|
||||
apiclient = std::make_shared<ApiClient>(apiconfiguration);
|
||||
api = std::make_shared<PetApi>(apiclient);
|
||||
}
|
||||
|
||||
OAIPetApiTests::~OAIPetApiTests() {
|
||||
|
||||
}
|
||||
|
||||
void OAIPetApiTests::runTests(){
|
||||
testAddPet();
|
||||
testFindPetsByStatus();
|
||||
testGetPetById();
|
||||
}
|
||||
|
||||
void OAIPetApiTests::testAddPet(){
|
||||
auto req = std::make_shared<Pet>();
|
||||
req->setId(12345);
|
||||
req->setName("cpprest-pet");
|
||||
req->setStatus(U("123"));
|
||||
|
||||
std::function<void()> responseCallback = []()
|
||||
{
|
||||
std::cout << "added pet successfully" << std::endl;
|
||||
};
|
||||
|
||||
auto reqTask = api->addPet(req).then(responseCallback);
|
||||
try{
|
||||
reqTask.wait();
|
||||
}
|
||||
catch(const ApiException& ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
catch(const std::exception &ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
void OAIPetApiTests::testFindPetsByStatus(){
|
||||
auto req = std::vector<utility::string_t>();
|
||||
req.push_back(U("123"));
|
||||
auto reqTask = api->findPetsByStatus(req)
|
||||
.then([=](std::vector<std::shared_ptr<Pet>> pets)
|
||||
{
|
||||
std::cout << "found pet successfully" << std::endl;
|
||||
});
|
||||
try{
|
||||
reqTask.wait();
|
||||
}
|
||||
catch(const ApiException& ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
catch(const std::exception &ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
void OAIPetApiTests::testGetPetById(){
|
||||
int req = 12345;
|
||||
auto responseCallback = std::bind(&OAIPetApiTests::getPetByIdCallback, this, std::placeholders::_1);
|
||||
|
||||
auto reqTask = api->getPetById(req).then(responseCallback);
|
||||
|
||||
try{
|
||||
reqTask.wait();
|
||||
}
|
||||
catch(const ApiException& ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
catch(const std::exception &ex){
|
||||
std::cout << ex.what() << std::endl << std::flush;
|
||||
std::string err(ex.what());
|
||||
}
|
||||
}
|
||||
|
||||
void OAIPetApiTests::getPetByIdCallback(std::shared_ptr<Pet> pet){
|
||||
std::cout << "found pet by id successfully" << std::endl;
|
||||
}
|
34
samples/client/petstore/cpp-restsdk/PetApiTests.h
Normal file
34
samples/client/petstore/cpp-restsdk/PetApiTests.h
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef OAI_PETAPI_TESTS_H
|
||||
#define OAI_PETAPI_TESTS_H
|
||||
|
||||
#include <memory>
|
||||
#include "client/ApiClient.h"
|
||||
#include "client/ApiConfiguration.h"
|
||||
#include "client/api/PetApi.h"
|
||||
#include "client/model/Pet.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
using namespace org::openapitools::client::api;
|
||||
|
||||
class OAIPetApiTests
|
||||
{
|
||||
public:
|
||||
explicit OAIPetApiTests(std::string host = U("http://petstore.swagger.io"), std::string basePath = U("/v2"));
|
||||
|
||||
virtual ~OAIPetApiTests();
|
||||
public:
|
||||
void runTests();
|
||||
private:
|
||||
void testAddPet();
|
||||
void testFindPetsByStatus();
|
||||
void testGetPetById();
|
||||
|
||||
void getPetByIdCallback(std::shared_ptr<Pet> pet);
|
||||
|
||||
std::shared_ptr<ApiConfiguration> apiconfiguration;
|
||||
std::shared_ptr<ApiClient> apiclient;
|
||||
std::shared_ptr<PetApi> api;
|
||||
};
|
||||
|
||||
#endif // OAI_PETAPI_TESTS_H
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
54
samples/client/petstore/cpp-restsdk/client/CMakeLists.txt
Normal file
54
samples/client/petstore/cpp-restsdk/client/CMakeLists.txt
Normal file
@ -0,0 +1,54 @@
|
||||
#
|
||||
# OpenAPI Petstore
|
||||
# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
#
|
||||
# The version of the OpenAPI document: 1.0.0
|
||||
#
|
||||
# https://openapi-generator.tech
|
||||
#
|
||||
# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
#PROJECT's NAME
|
||||
project(CppRestOpenAPIClient)
|
||||
|
||||
|
||||
# THE LOCATION OF OUTPUT BINARIES
|
||||
set(CMAKE_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib)
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_DIR})
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
# BUILD TYPE
|
||||
message("A ${CMAKE_BUILD_TYPE} build configuration is detected")
|
||||
|
||||
# Update require components as necessary
|
||||
#find_package(Boost 1.45.0 REQUIRED COMPONENTS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
|
||||
|
||||
# build and set path to cpp rest sdk
|
||||
set(CPPREST_ROOT ${PROJECT_SOURCE_DIR}/3rdParty/cpprest)
|
||||
set(CPPREST_INCLUDE_DIR ${CPPREST_ROOT}/include)
|
||||
set(CPPREST_LIBRARY_DIR ${CPPREST_ROOT}/lib)
|
||||
|
||||
include_directories(${PROJECT_SOURCE_DIR} api model ${CPPREST_INCLUDE_DIR})
|
||||
|
||||
|
||||
# If using vcpkg, set include directories. Also comment out CPPREST section above since vcpkg will handle it.
|
||||
# To install required vcpkg packages execute:
|
||||
# > vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows
|
||||
# set(VCPKG_ROOT "C:\\vcpkg\\installed\\x64-windows")
|
||||
# set(VCPKG_INCLUDE_DIR ${VCPKG_ROOT}/include)
|
||||
# set(VCPKG_LIBRARY_DIR ${VCPKG_ROOT}/lib)
|
||||
# include_directories(${PROJECT_SOURCE_DIR} api model ${VCPKG_INCLUDE_DIR})
|
||||
|
||||
#SUPPORTING FILES
|
||||
set(SUPPORTING_FILES "ApiClient" "ApiConfiguration" "ApiException" "HttpContent" "IHttpBody" "JsonBody" "ModelBase" "MultipartFormData" "Object")
|
||||
#SOURCE FILES
|
||||
file(GLOB SOURCE_FILES "api/*" "model/*")
|
||||
|
||||
add_library(${PROJECT_NAME} ${SUPPORTING_FILES} ${SOURCE_FILES})
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
@ -2,9 +2,9 @@
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.0-SNAPSHOT.
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 4.0.2-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
6
samples/client/petstore/cpp-restsdk/main.cpp
Normal file
6
samples/client/petstore/cpp-restsdk/main.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "PetApiTests.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
auto petTest = std::make_shared<OAIPetApiTests>();
|
||||
petTest->runTests();
|
||||
}
|
Loading…
Reference in New Issue
Block a user