Skip to content

Commit ef4c5dc

Browse files
committed
fix SpecFilter dropping HEAD ops
1 parent 9b5f305 commit ef4c5dc

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

modules/swagger-core/src/main/java/io/swagger/core/filter/SpecFilter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public Swagger filter(Swagger swagger, SwaggerSpecFilter filter, Map<String, Lis
4848
Path path = swagger.getPaths().get(resourcePath);
4949
Map<String, Operation> ops = new HashMap<String, Operation>();
5050
ops.put("get", path.getGet());
51+
ops.put("head", path.getHead());
5152
ops.put("put", path.getPut());
5253
ops.put("post", path.getPost());
5354
ops.put("delete", path.getDelete());

modules/swagger-core/src/test/resources/specFiles/petstore.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,28 @@
356356
"description": "Invalid ID supplied"
357357
}
358358
}
359+
},
360+
"head": {
361+
"tags": [
362+
"pet"
363+
],
364+
"parameters": [
365+
{
366+
"name": "petId",
367+
"in": "path",
368+
"description": "ID of pet that needs to be fetched",
369+
"required": true,
370+
"type": "string"
371+
}
372+
],
373+
"responses": {
374+
"404": {
375+
"description": "Pet not found"
376+
},
377+
"400": {
378+
"description": "Invalid ID supplied"
379+
}
380+
}
359381
}
360382
},
361383
"/user/logout": {

0 commit comments

Comments
 (0)