@SuppressWarnings("unchecked")
public Map<String, Object> getAPIDocs() {
Map<String, Object> docs = createRoot();
Map<String, Object> paths = (Map<String, Object>) docs.computeIfAbsent("paths", x -> U.map());
Map<String, Object> components = (Map<String, Object>) docs.computeIfAbsent("components", x -> U.map());
Map<String, Object> schemas = (Map<String, Object>) components.computeIfAbsent("schemas", x -> U.map());
schemas.computeIfAbsent("Error", x -> OpenAPIModel.defaultErrorSchema());
Do.group(findPublishableRoutes()).by(Route::path).forEach((path, routes) -> {
paths.put(path, Do.map(routes).toMap(
route -> route.verb().name().toLowerCase(),
route -> descRoute(route, components)
));
});
return docs;
}