20#ifndef ORES_HTTP_OPENAPI_ENDPOINT_REGISTRY_HPP
21#define ORES_HTTP_OPENAPI_ENDPOINT_REGISTRY_HPP
25#include "ores.http.api/domain/route.hpp"
26#include "ores.logging/make_logger.hpp"
28namespace ores::http::openapi {
34 std::string title =
"OreStudio HTTP API";
35 std::string description =
"RESTful API for OreStudio";
36 std::string version =
"1.0.0";
37 std::string contact_name;
38 std::string contact_email;
39 std::string license_name =
"GPL-3.0";
40 std::string license_url;
48 std::string description;
84 inline static std::string_view logger_name =
"ores.http.openapi.endpoint_registry";
88 static auto instance = make_logger(logger_name);
92 std::string method_to_string(domain::http_method method)
const;
95 std::vector<server_info> servers_;
96 std::vector<domain::route> routes_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Represents a registered route with pattern matching.
Definition route.hpp:83
API information for OpenAPI spec.
Definition endpoint_registry.hpp:33
Server information for OpenAPI spec.
Definition endpoint_registry.hpp:46
Registry for API endpoints that generates OpenAPI specification.
Definition endpoint_registry.hpp:54
void add_server(const server_info &server)
Adds a server to the spec.
std::string generate_swagger_ui_html(const std::string &spec_url="/openapi.json") const
Generates a minimal Swagger UI HTML page.
std::string generate_openapi_json() const
Generates the OpenAPI 3.0 JSON specification.
void set_info(const api_info &info)
Sets the API information.
void register_route(const domain::route &route)
Registers a route for documentation.