This is a migration of the api_docs from OSv. It replaces the static api-doc.json with a dynamic generated reply, this allows to register API in run time. The api_registry_builder is a helper class that holds the file and api path, simplifying registring both the api_doc handler and registering additional API. To use the api_doc, first generate a api_registry_builder. The registry supply two functions, one for registring the api_doc handler and one for registering an API. Both function are passed as an argument for the set_routes method of the http_server_control object. To find the handler, the get_exact_match in the routes object was needed to become public. Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
1.0 KiB
1.0 KiB