From 7190ed17880dcd6aeba46a79211c5b6dba1eae08 Mon Sep 17 00:00:00 2001 From: andreibogus Date: Mon, 22 Apr 2024 09:28:21 +0200 Subject: [PATCH] fix: adjust api docs for 'api/token' endpoint --- .../apidocs/SecureTokenControllerApiDoc.java | 8 ++++++-- .../controller/SecureTokenController.java | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/SecureTokenControllerApiDoc.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/SecureTokenControllerApiDoc.java index 587a8352c..6219ce535 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/SecureTokenControllerApiDoc.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/apidocs/SecureTokenControllerApiDoc.java @@ -130,7 +130,11 @@ public class SecureTokenControllerApiDoc { }) }) }) - @Operation(summary = "Create and Sign Access Tokens", description = "The endpoint for creating and signing access tokens which are to be used during a verifiable presentation flow.") - public @interface PostSecureTokenDoc { + @Operation(summary = "Create and Sign Access Tokens", description = "The endpoint for creating and signing access tokens which are to be used during a verifiable presentation flow.", method = "tokenJson") + public @interface PostSecureTokenDocJson { + } + + @Operation(summary = "Create and Sign Access Tokens", description = "The endpoint for creating and signing access tokens which are to be used during a verifiable presentation flow.", method = "tokenFormUrlencoded") + public @interface PostSecureTokenDocFormUrlencoded { } } diff --git a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java index 1027d6f48..42ca8b94e 100644 --- a/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java +++ b/src/main/java/org/eclipse/tractusx/managedidentitywallets/controller/SecureTokenController.java @@ -82,8 +82,8 @@ void initBinder(WebDataBinder webDataBinder) { @SneakyThrows @PostMapping(path = "/api/token", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) - @SecureTokenControllerApiDoc.PostSecureTokenDoc - public ResponseEntity token( + @SecureTokenControllerApiDoc.PostSecureTokenDocJson + public ResponseEntity tokenJson( @Valid @RequestBody SecureTokenRequest secureTokenRequest ) { return processTokenRequest(secureTokenRequest); @@ -91,8 +91,8 @@ public ResponseEntity token( @SneakyThrows @PostMapping(path = "/api/token", consumes = { MediaType.APPLICATION_FORM_URLENCODED_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE }) - @SecureTokenControllerApiDoc.PostSecureTokenDoc - public ResponseEntity token( + @SecureTokenControllerApiDoc.PostSecureTokenDocFormUrlencoded + public ResponseEntity tokenFormUrlencoded( @Valid @RequestBody MultiValueMap requestParameters ) { final SecureTokenRequest secureTokenRequest = getSecureTokenRequest(requestParameters);