cwist
Modern C web framework with libttak runtime
Loading...
Searching...
No Matches
openapi.h
Go to the documentation of this file.
1
25#ifndef CWIST_OPENAPI_H
26#define CWIST_OPENAPI_H
27
28#include <cwist/sys/app/app.h>
29
30/* Source-level route macros: preserve normal runtime routing while leaving an
31 * unambiguous, parseable declaration for documentation tooling. */
32#define CWIST_OPENAPI_GET(app, path, handler) cwist_app_get((app), (path), (handler))
33#define CWIST_OPENAPI_POST(app, path, handler) cwist_app_post((app), (path), (handler))
34#define CWIST_OPENAPI_PUT(app, path, handler) cwist_app_put((app), (path), (handler))
35#define CWIST_OPENAPI_DELETE(app, path, handler) cwist_app_delete((app), (path), (handler))
36#define CWIST_OPENAPI_PATCH(app, path, handler) cwist_app_patch((app), (path), (handler))
37
44typedef struct {
45 const char *title;
46 const char *version;
47 const char *description;
48 const char *server_url;
50
63void cwist_app_enable_openapi(cwist_app *app, const char *json_path,
64 const cwist_openapi_meta_t *meta);
65
78void cwist_openapi_annotate(cwist_app *app, const char *method, const char *path,
79 const char *summary, const char *tags);
80
81#endif
void cwist_app_enable_openapi(cwist_app *app, const char *json_path, const cwist_openapi_meta_t *meta)
Serve the app's OpenAPI 3.1 document.
Definition openapi.c:210
void cwist_openapi_annotate(cwist_app *app, const char *method, const char *path, const char *summary, const char *tags)
Attach a summary and tags to one operation of the document.
Definition openapi.c:242
Main Application Context.
Definition app.h:155
Per-application metadata for the generated OpenAPI document.
Definition openapi.h:44
const char * description
Definition openapi.h:47
const char * version
Definition openapi.h:46
const char * server_url
Definition openapi.h:48
const char * title
Definition openapi.h:45
Core Application Structure and Lifecycle Management.