Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkSwaggerController.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkSwaggerController_h
14 #define mitkSwaggerController_h
15 
16 #include <httplib.h>
17 
18 #include <MitkRESTAPIExports.h>
19 
20 #include <string>
21 #include <unordered_map>
22 
23 namespace mitk
24 {
38  {
39  public:
41 
43  void HandleGET_docs(const httplib::Request& req, httplib::Response& res);
44 
46  void HandleGET_docs_css(const httplib::Request& req, httplib::Response& res);
47 
49  void HandleGET_docs_js(const httplib::Request& req, httplib::Response& res);
50 
52  void HandleGET_openapi(const httplib::Request& req, httplib::Response& res);
53 
54  private:
67  std::string LoadResource(const std::string& resourcePath) const;
68 
70  std::unordered_map<std::string, std::string> m_ResourceCache;
71  };
72 }
73 
74 #endif
#define MITKRESTAPI_EXPORT
Serves Swagger UI and OpenAPI specification for API documentation.
void HandleGET_openapi(const httplib::Request &req, httplib::Response &res)
Handle GET /openapi.json - serves the OpenAPI specification.
void HandleGET_docs_js(const httplib::Request &req, httplib::Response &res)
Handle GET /docs/swagger-ui-bundle.js - serves Swagger UI JavaScript.
void HandleGET_docs_css(const httplib::Request &req, httplib::Response &res)
Handle GET /docs/swagger-ui.css - serves Swagger UI stylesheet.
void HandleGET_docs(const httplib::Request &req, httplib::Response &res)
Handle GET /docs - serves Swagger UI HTML page.
Find image slices visible on a given plane.