diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V1/Controllers/TeachersController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V1/Controllers/TeachersController.cs index cc3a5ce1df..9700c1615f 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V1/Controllers/TeachersController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V1/Controllers/TeachersController.cs @@ -19,10 +19,9 @@ public TeachersController(IMediator mediator) } [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetTeacher", - Summary = "Get teacher", - Description = "Gets a teacher by their DOB and either TRN or NINO")] + [EndpointName("GetTeacher"), + EndpointSummary("Get teacher"), + EndpointDescription("Gets a teacher by their DOB and either TRN or NINO")] [ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(void), StatusCodes.Status404NotFound)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/TeachersController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/TeachersController.cs index 61c5d14641..49c11d85ad 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/TeachersController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/TeachersController.cs @@ -18,10 +18,9 @@ public TeachersController(IMediator mediator) } [HttpGet("find")] - [SwaggerOperation( - OperationId = "FindTeachers", - Summary = "Find teachers", - Description = "Returns teachers matching the specified criteria")] + [EndpointName("FindTeachers"), + EndpointSummary("Find teachers"), + EndpointDescription("Returns teachers matching the specified criteria")] [ProducesResponseType(typeof(FindTeachersResponse), StatusCodes.Status200OK)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] public async Task FindTeachersAsync(FindTeachersRequest request) @@ -31,10 +30,9 @@ public async Task FindTeachersAsync(FindTeachersRequest request) } [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetTeacher", - Summary = "Get teacher", - Description = "Gets an individual teacher by their TRN")] + [EndpointName("GetTeacher"), + EndpointSummary("Get teacher"), + EndpointDescription("Gets an individual teacher by their TRN")] [ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] public async Task GetTeacherAsync([FromRoute] GetTeacherRequest request) diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/UnlockTeacherController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/UnlockTeacherController.cs index cefb7b37e4..2b351fdf2a 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/UnlockTeacherController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V2/Controllers/UnlockTeacherController.cs @@ -10,10 +10,9 @@ namespace TeachingRecordSystem.Api.V2.Controllers; public class UnlockTeacherController : ControllerBase { [HttpPut("{teacherId}")] - [SwaggerOperation( - OperationId = "UnlockTeacher", - Summary = "Unlock teacher", - Description = "Unlocks the teacher record allowing the teacher to sign in to the portals")] + [EndpointName("UnlockTeacher"), + EndpointSummary("Unlock teacher"), + EndpointDescription("Unlocks the teacher record allowing the teacher to sign in to the portals")] [ProducesResponseType(typeof(UnlockTeacherResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status404NotFound)] public IActionResult UnlockTeacher() => Ok(new UnlockTeacherResponse { HasBeenUnlocked = false }); diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/CertificatesController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/CertificatesController.cs index 06273b831c..b9e2397478 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/CertificatesController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/CertificatesController.cs @@ -10,37 +10,33 @@ public class CertificatesController : ControllerBase { [HttpGet] [Route("qts")] - [SwaggerOperation( - OperationId = "GetQtsCertificate", - Summary = "Get QTS Certificate", - Description = "Returns a PDF of the QTS Certificate for the authenticated teacher.")] + [EndpointName("GetQtsCertificate"), + EndpointSummary("Get QTS Certificate"), + EndpointDescription("Returns a PDF of the QTS Certificate for the authenticated teacher.")] [ProducesResponseType(typeof(void), StatusCodes.Status410Gone)] public IActionResult GetQts() => StatusCode(StatusCodes.Status410Gone); [HttpGet] [Route("eyts")] - [SwaggerOperation( - OperationId = "GetEytsCertificate", - Summary = "Get EYTS Certificate", - Description = "Returns a PDF of the EYTS Certificate for the authenticated teacher.")] + [EndpointName("GetEytsCertificate"), + EndpointSummary("Get EYTS Certificate"), + EndpointDescription("Returns a PDF of the EYTS Certificate for the authenticated teacher.")] [ProducesResponseType(typeof(void), StatusCodes.Status410Gone)] public IActionResult GetEyts() => StatusCode(StatusCodes.Status410Gone); [HttpGet] [Route("induction")] - [SwaggerOperation( - OperationId = "GetInductionCertificate", - Summary = "Induction Certificate", - Description = "Returns a PDF of the Induction Certificate for the authenticated teacher.")] + [EndpointName("GetInductionCertificate"), + EndpointSummary("Induction Certificate"), + EndpointDescription("Returns a PDF of the Induction Certificate for the authenticated teacher.")] [ProducesResponseType(typeof(void), StatusCodes.Status410Gone)] public IActionResult GetInduction() => StatusCode(StatusCodes.Status410Gone); [HttpGet] [Route("npq/{qualificationId}")] - [SwaggerOperation( - OperationId = "GetNpqCertificate", - Summary = "NPQ Certificate", - Description = "Returns a PDF of the NPQ Certificate associated with the provided qualification ID.")] + [EndpointName("GetNpqCertificate"), + EndpointSummary("NPQ Certificate"), + EndpointDescription("Returns a PDF of the NPQ Certificate associated with the provided qualification ID.")] [ProducesResponseType(typeof(void), StatusCodes.Status410Gone)] public IActionResult GetNpq() => StatusCode(StatusCodes.Status410Gone); } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeacherController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeacherController.cs index 9c2711e80d..8ff111bebc 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeacherController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeacherController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class TeacherController(ICommandDispatcher commandDispatcher, IMapper map { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentTeacher", - Summary = "Get the current teacher's details", - Description = "Gets the details for the authenticated teacher.")] + [EndpointName("GetCurrentTeacher"), + EndpointSummary("Get the current teacher's details"), + EndpointDescription("Gets the details for the authenticated teacher.")] [ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetTeacherRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetTeacherRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeachersController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeachersController.cs index ec297b1d56..b09ed41dc7 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeachersController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240101/Controllers/TeachersController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,17 +13,16 @@ namespace TeachingRecordSystem.Api.V3.V20240101.Controllers; public class TeachersController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetTeacherByTrn", - Summary = "Get teacher details by TRN", - Description = "Gets the details of the teacher corresponding to the given TRN.")] + [EndpointName("GetTeacherByTrn"), + EndpointSummary("Get teacher details by TRN"), + EndpointDescription("Gets the details of the teacher corresponding to the given TRN.")] [ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetTeacherRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetTeacherRequestIncludes? include) { var command = new GetPersonCommand( trn, @@ -43,10 +43,9 @@ public async Task GetAsync( } [HttpPost("name-changes")] - [SwaggerOperation( - OperationId = "CreateNameChange", - Summary = "Create name change request", - Description = "Creates a name change request for the teacher with the given TRN.")] + [EndpointName("CreateNameChange"), + EndpointSummary("Create name change request"), + EndpointDescription("Creates a name change request for the teacher with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.UpdatePerson)] @@ -70,10 +69,9 @@ public async Task CreateNameChangeAsync( } [HttpPost("date-of-birth-changes")] - [SwaggerOperation( - OperationId = "CreateDobChange", - Summary = "Create DOB change request", - Description = "Creates a date of birth change request for the teacher with the given TRN.")] + [EndpointName("CreateDobChange"), + EndpointSummary("Create DOB change request"), + EndpointDescription("Creates a date of birth change request for the teacher with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.UpdatePerson)] @@ -95,10 +93,9 @@ public async Task CreateDateOfBirthChangeAsync( } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindTeachers", - Summary = "Find teachers", - Description = "Finds teachers with a TRN matching the specified criteria.")] + [EndpointName("FindTeachers"), + EndpointSummary("Find teachers"), + EndpointDescription("Finds teachers with a TRN matching the specified criteria.")] [ProducesResponseType(typeof(FindTeachersResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Controllers/TrnRequestsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Controllers/TrnRequestsController.cs index a77c4fc102..05de62cadd 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Controllers/TrnRequestsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Controllers/TrnRequestsController.cs @@ -12,10 +12,9 @@ namespace TeachingRecordSystem.Api.V3.V20240307.Controllers; public class TrnRequestsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPost("")] - [SwaggerOperation( - OperationId = "CreateTrnRequest", - Summary = "Creates a TRN request", - Description = """ + [EndpointName("CreateTrnRequest"), + EndpointSummary("Creates a TRN request"), + EndpointDescription(""" Creates a new TRN request using the personally identifiable information in the request body. If the request can be fulfilled immediately the response's status property will be 'Completed' and a TRN will also be returned. Otherwise, the response's status property will be 'Pending' and the GET endpoint should be polled until a 'Completed' status is returned. @@ -47,10 +46,9 @@ public async Task CreateTrnRequestAsync( } [HttpGet("")] - [SwaggerOperation( - OperationId = "GetTrnRequest", - Summary = "Get the TRN request's details", - Description = """ + [EndpointName("GetTrnRequest"), + EndpointSummary("Get the TRN request's details"), + EndpointDescription(""" Gets the TRN request for the requestId specified in the query string. If the request's status is 'Completed' a TRN will also be returned. """)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Requests/CreateTrnRequestRequest.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Requests/CreateTrnRequestRequest.cs index c6037f0dc9..cd7a26d010 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Requests/CreateTrnRequestRequest.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240307/Requests/CreateTrnRequestRequest.cs @@ -1,10 +1,11 @@ +using System.ComponentModel; using TeachingRecordSystem.Core.ApiSchema.V3.V20240307.Dtos; namespace TeachingRecordSystem.Api.V3.V20240307.Requests; public record CreateTrnRequestRequest { - [SwaggerSchema(description: + [Description( "A unique ID that represents this request. " + "If a request has already been created with this ID then that existing record's result is returned.")] public required string RequestId { get; init; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240412/Controllers/TeacherController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240412/Controllers/TeacherController.cs index e185d4cf02..57c7d87d3a 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240412/Controllers/TeacherController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240412/Controllers/TeacherController.cs @@ -12,10 +12,9 @@ namespace TeachingRecordSystem.Api.V3.V20240412.Controllers; public class TeacherController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPost("name-changes")] - [SwaggerOperation( - OperationId = "CreateNameChange", - Summary = "Create name change request", - Description = "Creates a name change request for the authenticated teacher.")] + [EndpointName("CreateNameChange"), + EndpointSummary("Create name change request"), + EndpointDescription("Creates a name change request for the authenticated teacher.")] [ProducesResponseType(typeof(CreateNameChangeResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] @@ -38,10 +37,9 @@ public async Task CreateNameChangeAsync([FromBody] CreateNameChan } [HttpPost("date-of-birth-changes")] - [SwaggerOperation( - OperationId = "CreateDobChange", - Summary = "Create DOB change request", - Description = "Creates a date of birth change request for the authenticated teacher.")] + [EndpointName("CreateDobChange"), + EndpointSummary("Create DOB change request"), + EndpointDescription("Creates a date of birth change request for the authenticated teacher.")] [ProducesResponseType(typeof(CreateDateOfBirthChangeResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeacherController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeacherController.cs index 40181cfd21..a5b0e7f76f 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeacherController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeacherController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class TeacherController(ICommandDispatcher commandDispatcher, IMapper map { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentTeacher", - Summary = "Get the current teacher's details", - Description = "Gets the details for the authenticated teacher.")] + [EndpointName("GetCurrentTeacher"), + EndpointSummary("Get the current teacher's details"), + EndpointDescription("Gets the details for the authenticated teacher.")] [ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetTeacherRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetTeacherRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeachersController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeachersController.cs index 17f3d29f00..ec5cb56ad0 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeachersController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240416/Controllers/TeachersController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,18 +13,17 @@ namespace TeachingRecordSystem.Api.V3.V20240416.Controllers; public class TeachersController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetTeacherByTrn", - Summary = "Get teacher details by TRN", - Description = "Gets the details of the teacher corresponding to the given TRN.")] + [EndpointName("GetTeacherByTrn"), + EndpointSummary("Get teacher details by TRN"), + EndpointDescription("Gets the details of the teacher corresponding to the given TRN.")] [ProducesResponseType(typeof(GetTeacherResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetTeacherRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetTeacherRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth) { var command = new GetPersonCommand( trn, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonController.cs index 5b347ee2fb..f7b4b8cb07 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class PersonController(ICommandDispatcher commandDispatcher, IMapper mapp { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentPerson", - Summary = "Get the authenticated person's details", - Description = "Gets the details for the authenticated person.")] + [EndpointName("GetCurrentPerson"), + EndpointSummary("Get the authenticated person's details"), + EndpointDescription("Gets the details for the authenticated person.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, @@ -40,10 +40,9 @@ public async Task GetAsync( } [HttpPost("name-changes")] - [SwaggerOperation( - OperationId = "CreateNameChange", - Summary = "Create name change request", - Description = "Creates a name change request for the authenticated teacher.")] + [EndpointName("CreateNameChange"), + EndpointSummary("Create name change request"), + EndpointDescription("Creates a name change request for the authenticated teacher.")] [ProducesResponseType(typeof(CreateNameChangeResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] @@ -67,10 +66,9 @@ public async Task CreateNameChangeAsync( } [HttpPost("date-of-birth-changes")] - [SwaggerOperation( - OperationId = "CreateDobChange", - Summary = "Create DOB change request", - Description = "Creates a date of birth change request for the authenticated teacher.")] + [EndpointName("CreateDobChange"), + EndpointSummary("Create DOB change request"), + EndpointDescription("Creates a date of birth change request for the authenticated teacher.")] [ProducesResponseType(typeof(CreateDateOfBirthChangeResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonsController.cs index aef5dc0dcf..0052aaf366 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/PersonsController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,18 +13,17 @@ namespace TeachingRecordSystem.Api.V3.V20240606.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetPersonByTrn", - Summary = "Get person details by TRN", - Description = "Gets the details of the person corresponding to the given TRN.")] + [EndpointName("GetPersonByTrn"), + EndpointSummary("Get person details by TRN"), + EndpointDescription("Gets the details of the person corresponding to the given TRN.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth) { var command = new GetPersonCommand( trn, @@ -44,10 +44,9 @@ public async Task GetAsync( } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindPerson", - Summary = "Find person", - Description = "Finds a person matching the specified criteria.")] + [EndpointName("FindPerson"), + EndpointSummary("Find person"), + EndpointDescription("Finds a person matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/TrnRequestsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/TrnRequestsController.cs index b331b8c9bf..bbaf229c2e 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/TrnRequestsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Controllers/TrnRequestsController.cs @@ -12,10 +12,9 @@ namespace TeachingRecordSystem.Api.V3.V20240606.Controllers; public class TrnRequestsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPost("")] - [SwaggerOperation( - OperationId = "CreateTrnRequest", - Summary = "Creates a TRN request", - Description = """ + [EndpointName("CreateTrnRequest"), + EndpointSummary("Creates a TRN request"), + EndpointDescription(""" Creates a new TRN request using the personally identifiable information in the request body. If the request can be fulfilled immediately the response's status property will be 'Completed' and a TRN will also be returned. Otherwise, the response's status property will be 'Pending' and the GET endpoint should be polled until a 'Completed' status is returned. @@ -45,10 +44,9 @@ public async Task CreateTrnRequestAsync([FromBody] CreateTrnReque } [HttpGet("")] - [SwaggerOperation( - OperationId = "GetTrnRequest", - Summary = "Get the TRN request's details", - Description = """ + [EndpointName("GetTrnRequest"), + EndpointSummary("Get the TRN request's details"), + EndpointDescription(""" Gets the TRN request for the requestId specified in the query string. If the request's status is 'Completed' a TRN will also be returned. """)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Requests/CreateTrnRequestRequest.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Requests/CreateTrnRequestRequest.cs index 36019c5fc5..b983c34f1d 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Requests/CreateTrnRequestRequest.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240606/Requests/CreateTrnRequestRequest.cs @@ -1,8 +1,10 @@ +using System.ComponentModel; + namespace TeachingRecordSystem.Api.V3.V20240606.Requests; public record CreateTrnRequestRequest { - [SwaggerSchema(description: + [Description( "A unique ID that represents this request. " + "If a request has already been created with this ID then that existing record's result is returned.")] public required string RequestId { get; init; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240814/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240814/Controllers/PersonsController.cs index 7638785e68..d9b7d981bd 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240814/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240814/Controllers/PersonsController.cs @@ -11,10 +11,9 @@ namespace TeachingRecordSystem.Api.V3.V20240814.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPost("find")] - [SwaggerOperation( - OperationId = "FindPersons", - Summary = "Find persons", - Description = "Finds persons matching the specified criteria.")] + [EndpointName("FindPersons"), + EndpointSummary("Find persons"), + EndpointDescription("Finds persons matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -26,10 +25,9 @@ public async Task FindPersonsAsync([FromBody] FindPersonsRequest } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindPerson", - Summary = "Find person", - Description = "Finds a person matching the specified criteria.")] + [EndpointName("FindPerson"), + EndpointSummary("Find person"), + EndpointDescription("Finds a person matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240912/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240912/Controllers/PersonsController.cs index e3cafa8317..e93ce1f47c 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240912/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240912/Controllers/PersonsController.cs @@ -11,10 +11,9 @@ namespace TeachingRecordSystem.Api.V3.V20240912.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPut("{trn}/qtls")] - [SwaggerOperation( - OperationId = "SetQtls", - Summary = "Set QTLS status for a teacher", - Description = "Sets the QTLS status for the teacher with the given TRN.")] + [EndpointName("SetQtls"), + EndpointSummary("Set QTLS status for a teacher"), + EndpointDescription("Sets the QTLS status for the teacher with the given TRN.")] [ProducesResponseType(typeof(QtlsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.AssignQtls)] @@ -30,10 +29,9 @@ public async Task PutQtlsAsync( } [HttpGet("{trn}/qtls")] - [SwaggerOperation( - OperationId = "GetQtls", - Summary = "Get QTLS status for a teacher", - Description = "Gets the QTLS status for the teacher with the given TRN.")] + [EndpointName("GetQtls"), + EndpointSummary("Get QTLS status for a teacher"), + EndpointDescription("Gets the QTLS status for the teacher with the given TRN.")] [ProducesResponseType(typeof(QtlsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.AssignQtls)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonController.cs index 2a2d77a39f..bf6447fdea 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class PersonController(ICommandDispatcher commandDispatcher, IMapper mapp { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentPerson", - Summary = "Get the authenticated person's details", - Description = "Gets the details for the authenticated person.")] + [EndpointName("GetCurrentPerson"), + EndpointSummary("Get the authenticated person's details"), + EndpointDescription("Gets the details for the authenticated person.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonsController.cs index b040ffc07b..e15f046023 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20240920/Controllers/PersonsController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,18 +13,17 @@ namespace TeachingRecordSystem.Api.V3.V20240920.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetPersonByTrn", - Summary = "Get person details by TRN", - Description = "Gets the details of the person corresponding to the given TRN.")] + [EndpointName("GetPersonByTrn"), + EndpointSummary("Get person details by TRN"), + EndpointDescription("Gets the details of the person corresponding to the given TRN.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = $"{ApiRoles.GetPerson},{ApiRoles.AppropriateBody}")] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth) { include ??= GetPersonRequestIncludes.None; @@ -47,10 +47,9 @@ public async Task GetAsync( } [HttpPost("find")] - [SwaggerOperation( - OperationId = "FindPersons", - Summary = "Find persons", - Description = "Finds persons matching the specified criteria.")] + [EndpointName("FindPersons"), + EndpointSummary("Find persons"), + EndpointDescription("Finds persons matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -62,10 +61,9 @@ public async Task FindPersonsAsync([FromBody] FindPersonsRequest } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindPerson", - Summary = "Find person", - Description = "Finds a person matching the specified criteria.")] + [EndpointName("FindPerson"), + EndpointSummary("Find person"), + EndpointDescription("Finds a person matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -84,10 +82,9 @@ public async Task FindPersonsAsync(FindPersonRequest request) } [HttpPut("deceased/{trn}")] - [SwaggerOperation( - OperationId = "SetDeceased", - Summary = "Mark person as deceased", - Description = "Marks a person as deceased.")] + [EndpointName("SetDeceased"), + EndpointSummary("Mark person as deceased"), + EndpointDescription("Marks a person as deceased.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.UpdatePerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonController.cs index 4297c95c97..38a89ddf7e 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class PersonController(ICommandDispatcher commandDispatcher, IMapper mapp { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentPerson", - Summary = "Get the authenticated person's details", - Description = "Gets the details for the authenticated person.")] + [EndpointName("GetCurrentPerson"), + EndpointSummary("Get the authenticated person's details"), + EndpointDescription("Gets the details for the authenticated person.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonsController.cs index 6c33bf07ea..2f4127a283 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/PersonsController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,10 +13,9 @@ namespace TeachingRecordSystem.Api.V3.V20250203.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPut("{trn}/cpd-induction")] - [SwaggerOperation( - OperationId = "SetPersonCpdInductionStatus", - Summary = "Set person induction status", - Description = "Sets the induction details of the person with the given TRN.")] + [EndpointName("SetPersonCpdInductionStatus"), + EndpointSummary("Set person induction status"), + EndpointDescription("Sets the induction details of the person with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] @@ -39,19 +39,18 @@ public async Task SetCpdInductionStatusAsync( } [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetPersonByTrn", - Summary = "Get person details by TRN", - Description = "Gets the details of the person corresponding to the given TRN.")] + [EndpointName("GetPersonByTrn"), + EndpointSummary("Get person details by TRN"), + EndpointDescription("Gets the details of the person corresponding to the given TRN.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = $"{ApiRoles.GetPerson},{ApiRoles.AppropriateBody}")] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, + [FromQuery, Description("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) { include ??= GetPersonRequestIncludes.None; @@ -82,10 +81,9 @@ public async Task GetAsync( } [HttpPost("find")] - [SwaggerOperation( - OperationId = "FindPersons", - Summary = "Find persons", - Description = "Finds persons matching the specified criteria.")] + [EndpointName("FindPersons"), + EndpointSummary("Find persons"), + EndpointDescription("Finds persons matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -97,10 +95,9 @@ public async Task FindPersonsAsync([FromBody] FindPersonsRequest } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindPerson", - Summary = "Find person", - Description = "Finds a person matching the specified criteria.")] + [EndpointName("FindPerson"), + EndpointSummary("Find person"), + EndpointDescription("Finds a person matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/TrnRequestsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/TrnRequestsController.cs index 86110418dd..0162e051e9 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/TrnRequestsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Controllers/TrnRequestsController.cs @@ -13,10 +13,9 @@ namespace TeachingRecordSystem.Api.V3.V20250203.Controllers; public class TrnRequestsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPost("")] - [SwaggerOperation( - OperationId = "CreateTrnRequest", - Summary = "Creates a TRN request", - Description = """ + [EndpointName("CreateTrnRequest"), + EndpointSummary("Creates a TRN request"), + EndpointDescription(""" Creates a new TRN request using the personally identifiable information in the request body. If the request can be fulfilled immediately the response's status property will be 'Completed' and a TRN will also be returned. Otherwise, the response's status property will be 'Pending' and the GET endpoint should be polled until a 'Completed' status is returned. diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Requests/CreateTrnRequestRequest.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Requests/CreateTrnRequestRequest.cs index 9ef9b8ca22..9d48161734 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Requests/CreateTrnRequestRequest.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250203/Requests/CreateTrnRequestRequest.cs @@ -1,10 +1,11 @@ +using System.ComponentModel; using Gender = TeachingRecordSystem.Core.ApiSchema.V3.V20250203.Dtos.Gender; namespace TeachingRecordSystem.Api.V3.V20250203.Requests; public record CreateTrnRequestRequest { - [SwaggerSchema(description: + [Description( "A unique ID that represents this request. " + "If a request has already been created with this ID then that existing record's result is returned.")] public required string RequestId { get; init; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonController.cs index 44f4b4f1c4..8e35c2081c 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class PersonController(ICommandDispatcher commandDispatcher, IMapper mapp { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentPerson", - Summary = "Get the authenticated person's details", - Description = "Gets the details for the authenticated person.")] + [EndpointName("GetCurrentPerson"), + EndpointSummary("Get the authenticated person's details"), + EndpointDescription("Gets the details for the authenticated person.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonsController.cs index af33a53287..c21f778d3b 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250327/Controllers/PersonsController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,19 +13,18 @@ namespace TeachingRecordSystem.Api.V3.V20250327.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetPersonByTrn", - Summary = "Get person details by TRN", - Description = "Gets the details of the person corresponding to the given TRN.")] + [EndpointName("GetPersonByTrn"), + EndpointSummary("Get person details by TRN"), + EndpointDescription("Gets the details of the person corresponding to the given TRN.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = $"{ApiRoles.GetPerson},{ApiRoles.AppropriateBody}")] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, + [FromQuery, Description("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) { include ??= GetPersonRequestIncludes.None; @@ -55,10 +55,9 @@ public async Task GetAsync( } [HttpPost("find")] - [SwaggerOperation( - OperationId = "FindPersons", - Summary = "Find persons", - Description = "Finds persons matching the specified criteria.")] + [EndpointName("FindPersons"), + EndpointSummary("Find persons"), + EndpointDescription("Finds persons matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -70,10 +69,9 @@ public async Task FindPersonsAsync([FromBody] FindPersonsRequest } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindPerson", - Summary = "Find person", - Description = "Finds a person matching the specified criteria.")] + [EndpointName("FindPerson"), + EndpointSummary("Find person"), + EndpointDescription("Finds a person matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/PersonsController.cs index b354d62716..28d6c3942b 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/PersonsController.cs @@ -13,10 +13,9 @@ namespace TeachingRecordSystem.Api.V3.V20250425.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPut("{trn}/professional-statuses/{reference}")] - [SwaggerOperation( - OperationId = "SetProfessionalStatus", - Summary = "Sets a professional status", - Description = "Sets a professional status for the person with the given TRN.")] + [EndpointName("SetProfessionalStatus"), + EndpointSummary("Sets a professional status"), + EndpointDescription("Sets a professional status for the person with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.SetProfessionalStatus)] @@ -52,10 +51,9 @@ request.TrainingAgeSpecialism is null } [HttpPut("{trn}")] - [SwaggerOperation( - OperationId = "Set PII", - Summary = "Set a persons PII", - Description = "Sets a persons personally identifiable information with the given TRN.")] + [EndpointName("Set PII"), + EndpointSummary("Set a persons PII"), + EndpointDescription("Sets a persons personally identifiable information with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.UpdatePerson)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/TrnRequestsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/TrnRequestsController.cs index 81a9f427fb..9259323b18 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/TrnRequestsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Controllers/TrnRequestsController.cs @@ -13,10 +13,9 @@ namespace TeachingRecordSystem.Api.V3.V20250425.Controllers; public class TrnRequestsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpPost("")] - [SwaggerOperation( - OperationId = "CreateTrnRequest", - Summary = "Creates a TRN request", - Description = """ + [EndpointName("CreateTrnRequest"), + EndpointSummary("Creates a TRN request"), + EndpointDescription(""" Creates a new TRN request using the personally identifiable information in the request body. If the request can be fulfilled immediately the response's status property will be 'Completed' and a TRN will also be returned. Otherwise, the response's status property will be 'Pending' and the GET endpoint should be polled until a 'Completed' status is returned. @@ -48,10 +47,9 @@ public async Task CreateTrnRequestAsync([FromBody] CreateTrnReque } [HttpGet("")] - [SwaggerOperation( - OperationId = "GetTrnRequest", - Summary = "Get the TRN request's details", - Description = """ + [EndpointName("GetTrnRequest"), + EndpointSummary("Get the TRN request's details"), + EndpointDescription(""" Gets the TRN request for the requestId specified in the query string. If the request's status is 'Completed' a TRN will also be returned. """)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Requests/CreateTrnRequestRequest.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Requests/CreateTrnRequestRequest.cs index 94c48826d6..2a2ed785cc 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Requests/CreateTrnRequestRequest.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250425/Requests/CreateTrnRequestRequest.cs @@ -1,10 +1,11 @@ +using System.ComponentModel; using Gender = TeachingRecordSystem.Core.ApiSchema.V3.V20250203.Dtos.Gender; namespace TeachingRecordSystem.Api.V3.V20250425.Requests; public record CreateTrnRequestRequest { - [SwaggerSchema(description: + [Description( "A unique ID that represents this request. " + "If a request has already been created with this ID then that existing record's result is returned.")] public required string RequestId { get; init; } diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonController.cs index 9cf6205b60..790f94aad6 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using System.Security.Claims; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -14,14 +15,13 @@ public class PersonController(ICommandDispatcher commandDispatcher, IMapper mapp { [Authorize(AuthorizationPolicies.IdentityUserWithTrn)] [HttpGet] - [SwaggerOperation( - OperationId = "GetCurrentPerson", - Summary = "Get the authenticated person's details", - Description = "Gets the details for the authenticated person.")] + [EndpointName("GetCurrentPerson"), + EndpointSummary("Get the authenticated person's details"), + EndpointDescription("Gets the details for the authenticated person.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status403Forbidden)] public async Task GetAsync( - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include) { var command = new GetPersonCommand( Trn: User.FindFirstValue("trn")!, diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonsController.cs index 9e21d8faed..7d1fabd1bb 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250627/Controllers/PersonsController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Optional.Unsafe; @@ -14,19 +15,18 @@ namespace TeachingRecordSystem.Api.V3.V20250627.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetPersonByTrn", - Summary = "Get person details by TRN", - Description = "Gets the details of the person corresponding to the given TRN.")] + [EndpointName("GetPersonByTrn"), + EndpointSummary("Get person details by TRN"), + EndpointDescription("Gets the details of the person corresponding to the given TRN.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = $"{ApiRoles.GetPerson},{ApiRoles.AppropriateBody}")] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, + [FromQuery, Description("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) { include ??= GetPersonRequestIncludes.None; @@ -57,10 +57,9 @@ public async Task GetAsync( } [HttpPost("find")] - [SwaggerOperation( - OperationId = "FindPersons", - Summary = "Find persons", - Description = "Finds persons matching the specified criteria.")] + [EndpointName("FindPersons"), + EndpointSummary("Find persons"), + EndpointDescription("Finds persons matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonsResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -72,10 +71,9 @@ public async Task FindPersonsAsync([FromBody] FindPersonsRequest } [HttpGet("")] - [SwaggerOperation( - OperationId = "FindPerson", - Summary = "Find person", - Description = "Finds a person matching the specified criteria.")] + [EndpointName("FindPerson"), + EndpointSummary("Find person"), + EndpointDescription("Finds a person matching the specified criteria.")] [ProducesResponseType(typeof(FindPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.GetPerson)] @@ -98,10 +96,9 @@ public async Task FindPersonsAsync(FindPersonRequest request) public IActionResult SetProfessionalStatus() => throw null!; [HttpPut("{trn}/routes-to-professional-statuses/{reference}")] - [SwaggerOperation( - OperationId = "SetRouteToProfessionalStatus", - Summary = "Sets a route to professional status", - Description = "Sets a route to professional status for the person with the given TRN.")] + [EndpointName("SetRouteToProfessionalStatus"), + EndpointSummary("Sets a route to professional status"), + EndpointDescription("Sets a route to professional status for the person with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = ApiRoles.SetProfessionalStatus)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250905/Controllers/TrnsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250905/Controllers/TrnsController.cs index 5818b69135..d39248f1cd 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250905/Controllers/TrnsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20250905/Controllers/TrnsController.cs @@ -10,10 +10,9 @@ public class TrnsController(ICommandDispatcher commandDispatcher) : ControllerBa { [HttpGet("{trn}")] [ActionName("GetTrn")] - [SwaggerOperation( - OperationId = "GetTrn", - Summary = "Get a TRN", - Description = "Checks if the specified TRN exists.")] + [EndpointName("GetTrn"), + EndpointSummary("Get a TRN"), + EndpointDescription("Checks if the specified TRN exists.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status308PermanentRedirect)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20260120/Controllers/PersonsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20260120/Controllers/PersonsController.cs index a007ea73ed..37a5d5ef3d 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20260120/Controllers/PersonsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/V20260120/Controllers/PersonsController.cs @@ -1,3 +1,4 @@ +using System.ComponentModel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using TeachingRecordSystem.Api.Infrastructure.ModelBinding; @@ -12,10 +13,9 @@ namespace TeachingRecordSystem.Api.V3.V20260120.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher, IMapper mapper) : ControllerBase { [HttpGet("{trn}")] - [SwaggerOperation( - OperationId = "GetPersonByTrn", - Summary = "Get person details by TRN", - Description = "Gets the details of the person corresponding to the given TRN.")] + [EndpointName("GetPersonByTrn"), + EndpointSummary("Get person details by TRN"), + EndpointDescription("Gets the details of the person corresponding to the given TRN.")] [ProducesResponseType(typeof(GetPersonResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status308PermanentRedirect)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -24,9 +24,9 @@ public class PersonsController(ICommandDispatcher commandDispatcher, IMapper map [Authorize(Policy = AuthorizationPolicies.ApiKey, Roles = $"{ApiRoles.GetPerson},{ApiRoles.AppropriateBody}")] public async Task GetAsync( [FromRoute] string trn, - [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), SwaggerParameter("The additional properties to include in the response.")] GetPersonRequestIncludes? include, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, - [FromQuery, SwaggerParameter("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) + [FromQuery, ModelBinder(typeof(FlagsEnumStringListModelBinder)), Description("The additional properties to include in the response.")] GetPersonRequestIncludes? include, + [FromQuery, Description("Adds an additional check that the record has the specified dateOfBirth, if provided.")] DateOnly? dateOfBirth, + [FromQuery, Description("Adds an additional check that the record has the specified nationalInsuranceNumber, if provided.")] string? nationalInsuranceNumber) { include ??= GetPersonRequestIncludes.None; diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/AlertsController.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/AlertsController.cs index 9207c83ced..a3399dc530 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/AlertsController.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/AlertsController.cs @@ -11,38 +11,34 @@ namespace TeachingRecordSystem.Api.V3.VNext.Controllers; public class AlertsController : ControllerBase { [HttpPost("")] - [SwaggerOperation( - OperationId = "CreateAlert", - Summary = "Create an alert", - Description = "Creates an alert for the specified person.")] + [EndpointName("CreateAlert"), + EndpointSummary("Create an alert"), + EndpointDescription("Creates an alert for the specified person.")] [ProducesResponseType(typeof(AlertResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] public IActionResult CreateAlert([FromBody] CreateAlertRequestBody request) => throw new NotImplementedException(); [HttpGet("{alertId}")] - [SwaggerOperation( - OperationId = "GetAlert", - Summary = "Get an alert", - Description = "Gets the specified alert.")] + [EndpointName("GetAlert"), + EndpointSummary("Get an alert"), + EndpointDescription("Gets the specified alert.")] [ProducesResponseType(typeof(AlertResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] public IActionResult GetAlert([FromRoute] Guid alertId) => throw new NotImplementedException(); [HttpPatch("{alertId}")] - [SwaggerOperation( - OperationId = "UpdateAlert", - Summary = "Update an alert", - Description = "Updates the specified alert.")] + [EndpointName("UpdateAlert"), + EndpointSummary("Update an alert"), + EndpointDescription("Updates the specified alert.")] [ProducesResponseType(typeof(AlertResponse), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status404NotFound)] public IActionResult UpdateAlert([FromRoute] Guid alertId, [FromBody] UpdateAlertRequestBody request) => throw new NotImplementedException(); [HttpDelete("{alertId}")] - [SwaggerOperation( - OperationId = "DeleteAlert", - Summary = "Delete an alert", - Description = "Deletes a the specified alert.")] + [EndpointName("DeleteAlert"), + EndpointSummary("Delete an alert"), + EndpointDescription("Deletes a the specified alert.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] public IActionResult DeleteAlert([FromRoute] Guid alertId) => throw new NotImplementedException(); diff --git a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/PersonsController.EwcWales.cs b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/PersonsController.EwcWales.cs index 6d5b9722e5..1ffdef4ed4 100644 --- a/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/PersonsController.EwcWales.cs +++ b/TeachingRecordSystem/src/TeachingRecordSystem.Api/V3/VNext/Controllers/PersonsController.EwcWales.cs @@ -10,10 +10,9 @@ namespace TeachingRecordSystem.Api.V3.VNext.Controllers; public class PersonsController(ICommandDispatcher commandDispatcher) : ControllerBase { [HttpPut("{trn}/welsh-induction")] - [SwaggerOperation( - OperationId = "SetPersonWelshInductionStatus", - Summary = "Set person induction status", - Description = "Sets the induction details of the person with the given TRN.")] + [EndpointName("SetPersonWelshInductionStatus"), + EndpointSummary("Set person induction status"), + EndpointDescription("Sets the induction details of the person with the given TRN.")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]