AnCH Framework 0.2
Another C++ Hack: C++23 utility libraries
Loading...
Searching...
No Matches
anch::oas::ModelOptions Struct Reference

Models generation options. More...

#include <modelGenerator.hpp>

Collaboration diagram for anch::oas::ModelOptions:

Public Attributes

std::string ns = "model"
std::string name = "models"
bool uuid = true
bool date = true
bool strict = false
bool constraints = true
bool server = false
bool client = false
std::string api

Detailed Description

Models generation options.

Since
0.1
Author
Vincent Lachenal

Member Data Documentation

◆ api

std::string anch::oas::ModelOptions::api

API name: service is <api>Service and client is <api>Client (default: document title in PascalCase)

Since
0.2

◆ client

bool anch::oas::ModelOptions::client = false

Generate endpoints client side ( paths ): typed client based on anch::rest::Client (<name>-client.hpp and <name>-client.cpp)

Since
0.2

◆ constraints

bool anch::oas::ModelOptions::constraints = true

Generate value constraints ( minLength , minimum , minItems , ...) in mappers. Required properties are always checked.

Since
0.2

◆ date

bool anch::oas::ModelOptions::date = true

Map date-time string format to anch::date::DateTime and date format to anch::date::Date (RFC 3339, needs ANCH_DATE in anch-json), std::string otherwise

◆ name

std::string anch::oas::ModelOptions::name = "models"

Generated files base name: <name>.hpp and <name>.cpp

◆ ns

std::string anch::oas::ModelOptions::ns = "model"

Namespace of generated models (:: separated identifiers)

◆ server

bool anch::oas::ModelOptions::server = false

Generate endpoints server side ( paths ): service interface and its registration in anch::rest::Api (<name>-server.hpp and <name>-server.cpp)

Since
0.2

◆ strict

bool anch::oas::ModelOptions::strict = false

Raise an error on unsupported schema instead of skipping it with a warning

◆ uuid

bool anch::oas::ModelOptions::uuid = true

Map uuid string format to anch::UUID (needs ANCH_UUID in anch-json), std::string otherwise


The documentation for this struct was generated from the following file: