From f49f87ef9aa30aaba6c3d64e666710f8e64a6b12 Mon Sep 17 00:00:00 2001 From: Balloon Date: Tue, 22 Dec 2020 10:51:10 -0500 Subject: [PATCH] issue #160 (#161) - now will use existed audit info map --- .../src/main/java/com/networknt/openapi/OpenApiHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java b/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java index e8ee11b9..2651bd15 100644 --- a/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java +++ b/openapi-meta/src/main/java/com/networknt/openapi/OpenApiHandler.java @@ -109,7 +109,9 @@ public void handleRequest(final HttpServerExchange exchange) throws Exception { } String endpoint = openApiPathString.normalised() + "@" + httpMethod.toString().toLowerCase(); - Map auditInfo = new HashMap<>(); + Map auditInfo = exchange.getAttachment(AttachmentConstants.AUDIT_INFO) == null + ? new HashMap<>() + : exchange.getAttachment(AttachmentConstants.AUDIT_INFO); auditInfo.put(Constants.ENDPOINT_STRING, endpoint); auditInfo.put(Constants.OPENAPI_OPERATION_STRING, openApiOperation); exchange.putAttachment(AttachmentConstants.AUDIT_INFO, auditInfo);