![]() |
MySQL 9.3.0
Source Code Documentation
|
Helper class that facilitates generating OpenAPI swagger for the given DBobject entry. More...
Public Member Functions | |
OpenApiCreator (DbObjectPtr entry, rapidjson::Document::AllocatorType &allocator) | |
rapidjson::Value | create_get_method () const |
Create HTTP GET method contents for OpenAPI path. More... | |
rapidjson::Value | create_get_by_key_method () const |
Create HTTP GET method contents for OpenAPI path. More... | |
rapidjson::Value | create_post_method () const |
Create HTTP POST method contents for OpenAPI path. More... | |
rapidjson::Value | create_delete_method () const |
Create HTTP DELETE method contents for OpenAPI path. More... | |
rapidjson::Value | create_delete_by_key_method () const |
Create HTTP DELETE method contents for OpenAPI path. More... | |
rapidjson::Value | create_put_method () const |
Create HTTP PUT method contents for OpenAPI path. More... | |
rapidjson::Value | create_components () const |
Create OpenAPI components for the current entry. More... | |
bool | has_primary_key () const |
Information if the current entry contain Primary Key configured. More... | |
std::string | primary_key () const |
Get Primary Key value. More... | |
rapidjson::Value | get_procedure_items () const |
Add OpenAPI path items for MRS Funcions and Pocedure objects. More... | |
Private Member Functions | |
rapidjson::Value | add_type_constraints (const std::string &type_name, const mrs::database::entry::ColumnType type) const |
Add OpenAPI type constraints based on the MySQL datatype for the given column. More... | |
rapidjson::Value | create_parameter (std::string_view name, std::string_view type) const |
Add parameter for entries with Primary Key. More... | |
rapidjson::Value | get_filter_parameter (const bool is_required) const |
Add filter parameters to GET and DELETE methods. More... | |
rapidjson::Value | get_integer_parameter (const std::string &name) const |
Add 'limit' and 'offset' parameters to GET method. More... | |
rapidjson::Value | get_content_schema_array () const |
Create a reference to OpenAPI components section for methods that are returning multiple records. More... | |
rapidjson::Value | get_content_schema_single () const |
Create a reference to OpenAPI components section for methods that are returning one record. More... | |
void | add_security (rapidjson::Value &method) const |
Add security section if applicable. More... | |
rapidjson::Value | get_tag () const |
Tags that are going to be used to distinguish paths. More... | |
std::string | column_type_to_openapi (mrs::database::entry::ColumnType type) const |
Map column type to OpenAPI supported types. More... | |
rapidjson::Value | get_delete_response () const |
Response for successful DELETE operation. More... | |
rapidjson::Value | get_procedure_components () const |
Add OpenAPI component items for MRS Pocedure objects. More... | |
rapidjson::Value | get_function_components () const |
Add OpenAPI component items for MRS Funcion objects. More... | |
rapidjson::Value | get_procedure_result_example () const |
Get an example of a result set produced by a Procedure call. More... | |
std::optional< rapidjson::Value > | get_type_info (const std::string &raw_data_type) const |
Private Attributes | |
rapidjson::Document::AllocatorType & | allocator_ |
DbObjectPtr | entry_ |
const std::string | ref_name_ |
const std::string | schema_ref_ |
std::optional< std::string > | primary_key_ |
rapidjson::Value | parameters_ {rapidjson::kArrayType} |
Helper class that facilitates generating OpenAPI swagger for the given DBobject entry.
|
inline |
|
private |
Add security section if applicable.
|
private |
Add OpenAPI type constraints based on the MySQL datatype for the given column.
|
private |
Map column type to OpenAPI supported types.
rapidjson::Value mrs::rest::OpenApiCreator::create_components | ( | ) | const |
Create OpenAPI components for the current entry.
rapidjson::Value mrs::rest::OpenApiCreator::create_delete_by_key_method | ( | ) | const |
Create HTTP DELETE method contents for OpenAPI path.
Primary key used as a parameter.
rapidjson::Value mrs::rest::OpenApiCreator::create_delete_method | ( | ) | const |
Create HTTP DELETE method contents for OpenAPI path.
rapidjson::Value mrs::rest::OpenApiCreator::create_get_by_key_method | ( | ) | const |
Create HTTP GET method contents for OpenAPI path.
Primary key used as a parameter.
rapidjson::Value mrs::rest::OpenApiCreator::create_get_method | ( | ) | const |
Create HTTP GET method contents for OpenAPI path.
|
private |
Add parameter for entries with Primary Key.
rapidjson::Value mrs::rest::OpenApiCreator::create_post_method | ( | ) | const |
Create HTTP POST method contents for OpenAPI path.
rapidjson::Value mrs::rest::OpenApiCreator::create_put_method | ( | ) | const |
Create HTTP PUT method contents for OpenAPI path.
|
private |
Create a reference to OpenAPI components section for methods that are returning multiple records.
|
private |
Create a reference to OpenAPI components section for methods that are returning one record.
|
private |
Response for successful DELETE operation.
|
private |
Add filter parameters to GET and DELETE methods.
|
private |
Add OpenAPI component items for MRS Funcion objects.
|
private |
Add 'limit' and 'offset' parameters to GET method.
|
private |
Add OpenAPI component items for MRS Pocedure objects.
rapidjson::Value mrs::rest::OpenApiCreator::get_procedure_items | ( | ) | const |
Add OpenAPI path items for MRS Funcions and Pocedure objects.
|
private |
Get an example of a result set produced by a Procedure call.
|
private |
Tags that are going to be used to distinguish paths.
|
private |
|
inline |
Information if the current entry contain Primary Key configured.
|
inline |
Get Primary Key value.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |