Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 02f58478 authored by Flavio Ferraioli's avatar Flavio Ferraioli
Browse files

Document MTLSController

parent 3567d256
No related branches found
No related tags found
2 merge requests!106Release,!100Feature/open api
......@@ -4,6 +4,16 @@ import com.aruba.simpl.common.model.constants.SimplHeaders;
import com.aruba.simpl.common.model.dto.ParticipantWithIdentityAttributesDTO;
import com.aruba.simpl.usersroles.services.MtlsService;
import java.util.UUID;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
......@@ -17,6 +27,32 @@ public class MTLSController {
this.mtlsService = mtlsService;
}
@Operation(
summary = "Ping the participant",
description = "Performs a ping operation to check the participant's status using its UUID",
parameters = {
@Parameter(
name = SimplHeaders.PARTICIPANT_ID,
description = "The UUID of the participant",
required = true,
schema = @Schema(
type = "string",
format = "uuid",
example = "123e4567-e89b-12d3-a456-426614174000"))
},
responses = {
@ApiResponse(
responseCode = "200",
description = "Successfully pinged the participant",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = ParticipantWithIdentityAttributesDTO.class)
)
),
@ApiResponse(responseCode = "404", description = "Participant not found")
}
)
@GetMapping("ping")
public ParticipantWithIdentityAttributesDTO ping(@RequestHeader(SimplHeaders.PARTICIPANT_ID) UUID participantId) {
return mtlsService.ping(participantId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment