26#ifndef ROUTER_SRC_REST_MRS_SRC_MRS_REST_REST_OPENAPI_OBJECT_CREATOR_H_
27#define ROUTER_SRC_REST_MRS_SRC_MRS_REST_REST_OPENAPI_OBJECT_CREATOR_H_
29#ifdef RAPIDJSON_NO_SIZETYPEDEFINE
33#include <rapidjson/document.h>
69 const std::string &url, rapidjson::Document::AllocatorType &allocator);
90 rapidjson::Value &schema_properties,
91 rapidjson::Document::AllocatorType &allocator);
102 rapidjson::Document::AllocatorType &allocator);
116 const std::shared_ptr<mrs::database::entry::DbObject> &db_obj,
117 const std::shared_ptr<mrs::database::entry::DbSchema> &db_schema);
127 rapidjson::Document::AllocatorType &allocator);
139 std::vector<std::shared_ptr<mrs::interface::EndpointBase>> children) {
141 for (
const auto &child : children) {
142 auto child_endpoint = std::dynamic_pointer_cast<R>(child);
143 if (!child_endpoint)
continue;
145 result.push_back(child_endpoint.get());
149 [](
const auto &a,
const auto &b) {
150 return a->get()->request_path < b->
get()->request_path;
Logging interface for using and extending the logging subsystem.
#define IMPORT_LOG_FUNCTIONS()
convenience macro to avoid common boilerplate
Definition: logging.h:323
Define rapidjson::SizeType to be std::uint64_t.
bool is_supported(const std::shared_ptr< mrs::database::entry::DbObject > &db_obj, const std::shared_ptr< mrs::database::entry::DbSchema > &db_schema)
Check if the given DB Object entry can be used for getting an OpenAPI description.
Definition: openapi_object_creator.cc:1275
rapidjson::Value get_header_info(std::shared_ptr< DbService > service, rapidjson::Document::AllocatorType &allocator)
Create OpenAPI title, version and description.
Definition: openapi_object_creator.cc:59
void get_procedure_metadata_component(rapidjson::Value &schema_properties, rapidjson::Document::AllocatorType &allocator)
Create "_metadata" schema component item from a procedure call.
Definition: openapi_object_creator.cc:707
rapidjson::Value get_route_openapi_schema_path(const std::optional< uint32_t > privileges, DbObjectPtr entry, const std::string &url, rapidjson::Document::AllocatorType &allocator)
Create OpenAPI 'paths' section.
Definition: openapi_object_creator.cc:1210
std::shared_ptr< DbObject > DbObjectPtr
Definition: openapi_object_creator.h:50
constexpr std::string_view k_openapi_version
Definition: openapi_object_creator.h:54
constexpr std::string_view k_auth_method_name
Definition: openapi_object_creator.h:52
rapidjson::Value get_route_openapi_component(DbObjectPtr entry, rapidjson::Document::AllocatorType &allocator)
Create OpenAPI components section containing security schemes and schemas (type information with cons...
Definition: openapi_object_creator.cc:701
rapidjson::Value get_security_scheme(rapidjson::Document::AllocatorType &allocator)
Create security scheme for OpenAPI.
Definition: openapi_object_creator.cc:87
mrs::database::entry::DbService DbService
Definition: openapi_object_creator.h:49
constexpr std::string_view k_schema_version
Definition: openapi_object_creator.h:53
mrs::database::entry::DbObject DbObject
Definition: openapi_object_creator.h:48
std::vector< R * > sort_children_by_request_path(std::vector< std::shared_ptr< mrs::interface::EndpointBase > > children)
Sort Endpoint children by request path.
Definition: openapi_object_creator.h:138
Definition: authorize_manager.h:48
static mysql_service_status_t get(THD **thd) noexcept
Definition: mysql_current_thread_reader_all_empty.cc:31
const char * begin(const char *const c)
Definition: base64.h:44
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2876
struct result result
Definition: result.h:34
Definition: completion_hash.h:35