From 9b1d286b0753cd9345dc517a08aae049a3f7da6a Mon Sep 17 00:00:00 2001 From: Rob Vesse Date: Tue, 21 May 2019 10:58:08 +0100 Subject: [PATCH] Add support for HEAD requests The inflector ignored HEAD requests, this commit enables HEAD requests to be supported --- src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java b/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java index 64e96392..64a33ec8 100644 --- a/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java +++ b/src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java @@ -162,6 +162,10 @@ protected void init(Configuration configuration) { if (operation != null) { addOperation(pathString, builder, HttpMethod.GET, operation, definitions); } + operation = pathItem.getHead(); + if (operation != null) { + addOperation(pathString, builder, HttpMethod.HEAD, operation, definitions); + } operation = pathItem.getPost(); if (operation != null) { addOperation(pathString, builder, HttpMethod.POST, operation, definitions);