Helper class that facilitates generating OpenAPI swagger for the given DBobject entry.
More...
Helper class that facilitates generating OpenAPI swagger for the given DBobject entry.
◆ OpenApiCreator()
mrs::rest::OpenApiCreator::OpenApiCreator |
( |
DbObjectPtr |
entry, |
|
|
rapidjson::Document::AllocatorType & |
allocator |
|
) |
| |
|
inline |
◆ add_security()
void mrs::rest::OpenApiCreator::add_security |
( |
rapidjson::Value & |
method | ) |
const |
|
private |
Add security section if applicable.
◆ add_type_constraints()
Add OpenAPI type constraints based on the MySQL datatype for the given column.
◆ column_type_to_openapi()
Map column type to OpenAPI supported types.
◆ create_components()
rapidjson::Value mrs::rest::OpenApiCreator::create_components |
( |
| ) |
const |
Create OpenAPI components for the current entry.
◆ create_delete_by_key_method()
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.
◆ create_delete_method()
rapidjson::Value mrs::rest::OpenApiCreator::create_delete_method |
( |
| ) |
const |
Create HTTP DELETE method contents for OpenAPI path.
◆ create_get_by_key_method()
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.
◆ create_get_method()
rapidjson::Value mrs::rest::OpenApiCreator::create_get_method |
( |
| ) |
const |
Create HTTP GET method contents for OpenAPI path.
◆ create_parameter()
rapidjson::Value mrs::rest::OpenApiCreator::create_parameter |
( |
std::string_view |
name, |
|
|
std::string_view |
type |
|
) |
| const |
Add parameter for entries with Primary Key.
◆ create_post_method()
rapidjson::Value mrs::rest::OpenApiCreator::create_post_method |
( |
| ) |
const |
Create HTTP POST method contents for OpenAPI path.
◆ create_put_method()
rapidjson::Value mrs::rest::OpenApiCreator::create_put_method |
( |
| ) |
const |
Create HTTP PUT method contents for OpenAPI path.
◆ get_content_schema_array()
rapidjson::Value mrs::rest::OpenApiCreator::get_content_schema_array |
( |
| ) |
const |
|
private |
Create a reference to OpenAPI components section for methods that are returning multiple records.
◆ get_content_schema_single()
rapidjson::Value mrs::rest::OpenApiCreator::get_content_schema_single |
( |
| ) |
const |
|
private |
Create a reference to OpenAPI components section for methods that are returning one record.
◆ get_delete_response()
rapidjson::Value mrs::rest::OpenApiCreator::get_delete_response |
( |
| ) |
const |
|
private |
Response for successful DELETE operation.
◆ get_filter_parameter()
rapidjson::Value mrs::rest::OpenApiCreator::get_filter_parameter |
( |
const bool |
is_required | ) |
const |
|
private |
Add filter parameters to GET and DELETE methods.
◆ get_function_components()
rapidjson::Value mrs::rest::OpenApiCreator::get_function_components |
( |
| ) |
const |
|
private |
Add OpenAPI component items for MRS Funcion objects.
◆ get_integer_parameter()
rapidjson::Value mrs::rest::OpenApiCreator::get_integer_parameter |
( |
const std::string & |
name | ) |
const |
|
private |
Add 'limit' and 'offset' parameters to GET method.
◆ get_procedure_components()
rapidjson::Value mrs::rest::OpenApiCreator::get_procedure_components |
( |
| ) |
const |
|
private |
Add OpenAPI component items for MRS Pocedure objects.
◆ get_procedure_items()
rapidjson::Value mrs::rest::OpenApiCreator::get_procedure_items |
( |
const std::optional< uint32_t > |
privileges, |
|
|
const bool |
is_async |
|
) |
| const |
Add OpenAPI path items for MRS Funcions and Pocedure objects.
- Parameters
-
[in] | is_async | Callable supports async operations |
[in] | privileges | User privileges |
◆ get_procedure_result_example()
rapidjson::Value mrs::rest::OpenApiCreator::get_procedure_result_example |
( |
| ) |
const |
|
private |
Get an example of a result set produced by a Procedure call.
◆ get_tag()
rapidjson::Value mrs::rest::OpenApiCreator::get_tag |
( |
| ) |
const |
|
private |
Tags that are going to be used to distinguish paths.
◆ get_type_info()
std::optional< rapidjson::Value > mrs::rest::OpenApiCreator::get_type_info |
( |
const std::string & |
raw_data_type | ) |
const |
|
private |
◆ has_primary_key()
bool mrs::rest::OpenApiCreator::has_primary_key |
( |
| ) |
const |
|
inline |
Information if the current entry contain Primary Key configured.
◆ primary_key()
std::string mrs::rest::OpenApiCreator::primary_key |
( |
| ) |
const |
|
inline |
◆ allocator_
rapidjson::Document::AllocatorType& mrs::rest::OpenApiCreator::allocator_ |
|
private |
◆ entry_
◆ parameters_
rapidjson::Value mrs::rest::OpenApiCreator::parameters_ {rapidjson::kArrayType} |
|
private |
◆ primary_key_
std::optional<std::string> mrs::rest::OpenApiCreator::primary_key_ |
|
private |
◆ ref_name_
const std::string mrs::rest::OpenApiCreator::ref_name_ |
|
private |
◆ schema_ref_
const std::string mrs::rest::OpenApiCreator::schema_ref_ |
|
private |
The documentation for this class was generated from the following file: