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>
71 const std::string &url,
const bool is_async,
72 rapidjson::Document::AllocatorType &allocator);
93 rapidjson::Value &schema_properties,
94 rapidjson::Document::AllocatorType &allocator);
105 rapidjson::Document::AllocatorType &allocator);
119 const std::shared_ptr<mrs::database::entry::DbObject> &db_obj,
120 const std::shared_ptr<mrs::database::entry::DbSchema> &db_schema);
130 rapidjson::Document::AllocatorType &allocator);
142 std::vector<std::shared_ptr<mrs::interface::EndpointBase>> children) {
144 for (
const auto &child : children) {
145 auto child_endpoint = std::dynamic_pointer_cast<R>(child);
146 if (!child_endpoint)
continue;
148 result.push_back(child_endpoint.get());
152 [](
const auto &a,
const auto &b) {
153 return a->get()->request_path < b->
get()->request_path;
180 rapidjson::Document::AllocatorType &allocator);
Logging interface for using and extending the logging subsystem.
#define IMPORT_LOG_FUNCTIONS()
convenience macro to avoid common boilerplate
Definition: logging.h:331
Define rapidjson::SizeType to be std::uint64_t.
rapidjson::Value get_route_openapi_schema_path(const std::optional< uint32_t > privileges, DbObjectPtr entry, const std::string &url, const bool is_async, rapidjson::Document::AllocatorType &allocator)
Create OpenAPI 'paths' section.
Definition: openapi_object_creator.cc:1277
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:1346
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:69
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:720
std::shared_ptr< DbObject > DbObjectPtr
Definition: openapi_object_creator.h:51
constexpr std::string_view k_openapi_version
Definition: openapi_object_creator.h:55
constexpr std::string_view k_auth_method_name
Definition: openapi_object_creator.h:53
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:714
rapidjson::Value get_security_scheme(rapidjson::Document::AllocatorType &allocator)
Create security scheme for OpenAPI.
Definition: openapi_object_creator.cc:97
mrs::database::entry::DbService DbService
Definition: openapi_object_creator.h:50
constexpr std::string_view k_schema_version
Definition: openapi_object_creator.h:54
mrs::database::entry::DbObject DbObject
Definition: openapi_object_creator.h:49
rapidjson::Value add_task_id_endpoint(const std::optional< uint32_t > privileges, DbObjectPtr entry, rapidjson::Document::AllocatorType &allocator)
Add specification related to endpoint responsible for async operations (located at /service/schema/ob...
Definition: openapi_object_creator.cc:1359
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:141
bool async_enabled(const std::optional< std::string > &options)
Check if asynchronous tasks are enabled in options.
Definition: openapi_object_creator.cc:60
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
Definition: options.cc:57
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