diff --git a/lib/class-wp-rest-swagger-controller.php b/lib/class-wp-rest-swagger-controller.php index 57d4314..715c693 100644 --- a/lib/class-wp-rest-swagger-controller.php +++ b/lib/class-wp-rest-swagger-controller.php @@ -294,6 +294,23 @@ function ($matches) use (&$defaultidParams){ ,'responses'=>$responses ); + + if($methodName=='GET') { + $swagger['paths'][$endpointName]['head'] = array( + 'parameters'=>$parameters + ,'security'=>$security + ,'responses'=>array( + 200=>array( + 'description'=> "successful operation" + ) + ,'default'=>array( + 'description'=> "error" + ,'schema'=>array('$ref'=>'#/definitions/error') + ) + ) + + ); + } } }