forked from loafle/openapi-generator-original
Add standalone C++ server using cpp-httplib for OpenAPI-based APIs (#21724)
Supports: All OpenAPI 3.x data types: primitives, arrays, enums, nullable/optional fields, nested objects All parameter types: path, query, header, cookie, and combinations Schema composition: allOf (inheritance), oneOf (discriminated unions), anyOf (flexible unions) Security schemes: API key and bearer token authentication Discriminator-based polymorphic deserialization and error handling Provides: Error handling for invalid JSON, type mismatches, missing/unknown discriminator, and parameter validation Build system integration (CMake) for easy compilation and linking with required dependencies Clear build and run instructions for local development and testing Enables comprehensive, real-world validation of generated C++ server code against OpenAPI specifications
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
|
||||
/**
|
||||
* This file is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
#include "SimpleObject.h"
|
||||
|
||||
namespace models {
|
||||
|
||||
SimpleObject::SimpleObject()
|
||||
: id(0)
|
||||
, name("")
|
||||
, description("")
|
||||
{
|
||||
}
|
||||
// =========================================
|
||||
// ===== Getters/Setters =====
|
||||
// =========================================
|
||||
// ===================
|
||||
// ===== Getters =====
|
||||
// ===================
|
||||
int SimpleObject::getId() const
|
||||
{
|
||||
return id;
|
||||
}
|
||||
std::string SimpleObject::getName() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
std::string SimpleObject::getDescription() const
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
// ===================
|
||||
// ===== Setters =====
|
||||
// ===================
|
||||
void SimpleObject::setId(const int& idObj)
|
||||
{
|
||||
id = idObj;
|
||||
}
|
||||
void SimpleObject::setName(const std::string& nameObj)
|
||||
{
|
||||
name = nameObj;
|
||||
}
|
||||
void SimpleObject::setDescription(const std::string& descriptionObj)
|
||||
{
|
||||
description = descriptionObj;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace models
|
||||
|
||||
Reference in New Issue
Block a user