Added json content-type header to doc request body if needed

This commit is contained in:
Ezra Obiwale
2019-01-08 10:17:27 +01:00
parent f582f7b9da
commit 127de8eaf7

View File

@@ -83,6 +83,9 @@ class GenerateDocumentation extends Command
$parsedRouteOutput = $parsedRoutes->map(function ($routeGroup) {
return $routeGroup->map(function ($route) {
if (count($route['cleanBodyParameters'])) {
$route['headers']['Content-Type'] = 'application/json';
}
$route['output'] = (string) view('apidoc::partials.route')->with('route', $route)->render();
return $route;