Skip to content

Commit

Permalink
fix: adjust api docs for 'api/token' endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibogus committed May 28, 2024
1 parent 613831e commit 7190ed1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ void initBinder(WebDataBinder webDataBinder) {

@SneakyThrows
@PostMapping(path = "/api/token", consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE })
@SecureTokenControllerApiDoc.PostSecureTokenDoc
public ResponseEntity<StsTokenResponse> token(
@SecureTokenControllerApiDoc.PostSecureTokenDocJson
public ResponseEntity<StsTokenResponse> tokenJson(
@Valid @RequestBody SecureTokenRequest secureTokenRequest
) {
return processTokenRequest(secureTokenRequest);
}

@SneakyThrows
@PostMapping(path = "/api/token", consumes = { MediaType.APPLICATION_FORM_URLENCODED_VALUE }, produces = { MediaType.APPLICATION_JSON_VALUE })
@SecureTokenControllerApiDoc.PostSecureTokenDoc
public ResponseEntity<StsTokenResponse> token(
@SecureTokenControllerApiDoc.PostSecureTokenDocFormUrlencoded
public ResponseEntity<StsTokenResponse> tokenFormUrlencoded(
@Valid @RequestBody MultiValueMap<String, String> requestParameters
) {
final SecureTokenRequest secureTokenRequest = getSecureTokenRequest(requestParameters);
Expand Down

0 comments on commit 7190ed1

Please sign in to comment.