Model.hpp

This File On Github
Ask A Question

API: latest
module: oatpp-swagger
#include "oatpp-swagger/Model.hpp"

This is the general model for swagger info. It is used as a base model to generate API info for a particular API specification. Ex. for OAS3

Contact

Contact.

namespace oatpp { namespace swagger { 
  struct Contact {}
}}

Fields

Type Name Summary
String name name.
String url url.
String email email.

Methods

Return Type Name Summary
std::shared_ptr<Contact> createShared Create shared Contact.

Contact::name

name.

String name

Contact::url

url.

String url

Contact::email

email.

String email

Contact::createShared

Create shared Contact.

  • @return - 'std::shared_ptr' to Contact.

static std::shared_ptr<Contact> createShared()

License

License.

namespace oatpp { namespace swagger { 
  struct License {}
}}

Fields

Type Name Summary
String name name.
String url Url.

Methods

Return Type Name Summary
std::shared_ptr<License> createShared Create shared License.

License::name

name.

String name

License::url

Url.

String url

License::createShared

Create shared License.

  • @return - 'std::shared_ptr' to License.

static std::shared_ptr<License> createShared()

DocumentHeader

Document Header.

namespace oatpp { namespace swagger { 
  struct DocumentHeader {}
}}

Fields

Type Name Summary
String title Document title.
String description Document description.
String termsOfService Terms of service.
std::shared_ptr<Contact> contact Contact.
std::shared_ptr<License> license License.
String version Version.

Methods

Return Type Name Summary
std::shared_ptr<DocumentHeader> createShared Create shared DocumentHeader.

DocumentHeader::title

Document title.

String title

DocumentHeader::description

Document description.

String description

DocumentHeader::termsOfService

Terms of service.

String termsOfService

DocumentHeader::contact

Contact.

std::shared_ptr<Contact> contact

DocumentHeader::license

License.

std::shared_ptr<License> license

DocumentHeader::version

Version.

String version

DocumentHeader::createShared

Create shared DocumentHeader.

  • @return - 'std::shared_ptr' to DocumentHeader.

static std::shared_ptr<DocumentHeader> createShared()

ServerVariable

Server variable.

namespace oatpp { namespace swagger { 
  struct ServerVariable {}
}}

Fields

Type Name Summary
String description Description.
std::shared_ptr<oatpp::collection::LinkedList<String>> enumValues Enum values.
String defaultValue Default value.

Methods

Return Type Name Summary
std::shared_ptr<ServerVariable> createShared Create shared ServerVariable.

ServerVariable::description

Description.

String description

ServerVariable::enumValues

Enum values.

std::shared_ptr<oatpp::collection::LinkedList<String>> enumValues

ServerVariable::defaultValue

Default value.

String defaultValue

ServerVariable::createShared

Create shared ServerVariable.

  • @return - 'std::shared_ptr' to ServerVariable.

static std::shared_ptr<ServerVariable> createShared()

Server

Server

namespace oatpp { namespace swagger { 
  struct Server {}
}}

Fields

Type Name Summary
String url Url.
String description Description.
std::shared_ptr<oatpp::collection::ListMap<String, std::shared_ptr<ServerVariable>>> variables Variables.

Methods

Return Type Name Summary
std::shared_ptr<Server> createShared Create shared Server.

Server::url

Url.

String url

Server::description

Description.

String description

Server::variables

Variables.

std::shared_ptr<oatpp::collection::ListMap<String, std::shared_ptr<ServerVariable>>> variables

Server::createShared

Create shared Server.

  • @return - 'std::shared_ptr' to Server.

static std::shared_ptr<Server> createShared()

DocumentInfo

Document Info.

namespace oatpp { namespace swagger { 
  class DocumentInfo {}
}}

Fields

Type Name Summary
std::shared_ptr<DocumentHeader> header DocumentHeader.
std::shared_ptr<oatpp::collection::LinkedList<std::shared_ptr<Server>>> servers List of Server.

Methods

Return Type Name Summary
std::shared_ptr<DocumentInfo> createShared Create shared DocumentInfo.

DocumentInfo::header

DocumentHeader.

std::shared_ptr<DocumentHeader> header

DocumentInfo::servers

List of Server.

std::shared_ptr<oatpp::collection::LinkedList<std::shared_ptr<Server>>> servers

DocumentInfo::createShared

Create shared DocumentInfo.

  • @return - 'std::shared_ptr' to DocumentInfo.

static std::shared_ptr<DocumentInfo> createShared()

DocumentInfo::Builder

Document Info Builder.

namespace oatpp { namespace swagger { 
  class DocumentInfo {
    class Builder {}
  };
}}

Methods

Return Type Name Summary
Builder& setTitle Set document title.
Builder& setDescription Set document description.
Builder& setTermsOfService Set terms of service.
Builder& setVersion Set version.
Builder& setContactName Set contact name.
Builder& setContactUrl Set contact url.
Builder& setContactEmail Set contact email.
Builder& setLicenseName Set license name.
Builder& setLicenseUrl Set license url.
Builder& addServer Multiple implementations:
  1. Add Server.
  2. Add Server.
std::shared_ptr<DocumentInfo> build Build Document Info.

DocumentInfo::Builder::setTitle

Set document title.

Builder& setTitle(const oatpp::String& title)

DocumentInfo::Builder::setDescription

Set document description.

Builder& setDescription(const oatpp::String& description)

DocumentInfo::Builder::setTermsOfService

Set terms of service.

Builder& setTermsOfService(const oatpp::String& termsOfService)

DocumentInfo::Builder::setVersion

Set version.

Builder& setVersion(const oatpp::String& version)

DocumentInfo::Builder::setContactName

Set contact name.

Builder& setContactName(const oatpp::String& name)

DocumentInfo::Builder::setContactUrl

Set contact url.

Builder& setContactUrl(const oatpp::String& url)

DocumentInfo::Builder::setContactEmail

Set contact email.

Builder& setContactEmail(const oatpp::String& email)

DocumentInfo::Builder::setLicenseName

Set license name.

Builder& setLicenseName(const oatpp::String& name)

DocumentInfo::Builder::setLicenseUrl

Set license url.

Builder& setLicenseUrl(const oatpp::String& url)

DocumentInfo::Builder::addServer

  1. Add Server.
    Builder& addServer(const std::shared_ptr<Server>& server)
    
  2. Add Server.
    Builder& addServer(const oatpp::String& url, const oatpp::String& description)
    

DocumentInfo::Builder::build

Build Document Info.

std::shared_ptr<DocumentInfo> build()