diff --git a/src/Services/Booking/src/Booking/Booking/Features/CreateBooking/Endpoints/V1/CreateBookingEndpoint.cs b/src/Services/Booking/src/Booking/Booking/Features/CreateBooking/Endpoints/V1/CreateBookingEndpoint.cs index a139b29..5a4e85c 100644 --- a/src/Services/Booking/src/Booking/Booking/Features/CreateBooking/Endpoints/V1/CreateBookingEndpoint.cs +++ b/src/Services/Booking/src/Booking/Booking/Features/CreateBooking/Endpoints/V1/CreateBookingEndpoint.cs @@ -12,6 +12,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Booking.Booking.Features.CreateBooking.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class CreateBookingEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -22,9 +24,21 @@ public class CreateBookingEndpoint : IMinimalEndpoint .WithName("CreateBooking") .WithMetadata(new SwaggerOperationAttribute("Create Booking", "Create Booking")) .WithApiVersionSet(endpoints.NewApiVersionSet("Booking").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "Booking Created", + typeof(ulong))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Aircrafts/Features/CreateAircraft/Endpoints/V1/CreateAircraftEndpoint.cs b/src/Services/Flight/src/Flight/Aircrafts/Features/CreateAircraft/Endpoints/V1/CreateAircraftEndpoint.cs index e394a85..168699a 100644 --- a/src/Services/Flight/src/Flight/Aircrafts/Features/CreateAircraft/Endpoints/V1/CreateAircraftEndpoint.cs +++ b/src/Services/Flight/src/Flight/Aircrafts/Features/CreateAircraft/Endpoints/V1/CreateAircraftEndpoint.cs @@ -13,6 +13,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Aircrafts.Features.CreateAircraft.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class CreateAircraftEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -23,9 +25,21 @@ public class CreateAircraftEndpoint : IMinimalEndpoint .WithName("CreateAircraft") .WithMetadata(new SwaggerOperationAttribute("Create Aircraft", "Create Aircraft")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "Aircraft Created", + typeof(AircraftResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Airports/Features/CreateAirport/Endpoints/V1/CreateAirportEndpoint.cs b/src/Services/Flight/src/Flight/Airports/Features/CreateAirport/Endpoints/V1/CreateAirportEndpoint.cs index d017195..779fca8 100644 --- a/src/Services/Flight/src/Flight/Airports/Features/CreateAirport/Endpoints/V1/CreateAirportEndpoint.cs +++ b/src/Services/Flight/src/Flight/Airports/Features/CreateAirport/Endpoints/V1/CreateAirportEndpoint.cs @@ -13,6 +13,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Airports.Features.CreateAirport.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class CreateAirportEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -23,9 +25,21 @@ public class CreateAirportEndpoint : IMinimalEndpoint .WithName("CreateAirport") .WithMetadata(new SwaggerOperationAttribute("Create Airport", "Create Airport")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "Airport Created", + typeof(AirportResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Flights/Features/CreateFlight/Endpoints/V1/CreateFlightEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/CreateFlight/Endpoints/V1/CreateFlightEndpoint.cs index 49a5d54..ef1b517 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/CreateFlight/Endpoints/V1/CreateFlightEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/CreateFlight/Endpoints/V1/CreateFlightEndpoint.cs @@ -14,6 +14,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Flights.Features.CreateFlight.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class CreateFlightEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -24,9 +26,21 @@ public class CreateFlightEndpoint : IMinimalEndpoint .WithName("CreateFlight") .WithMetadata(new SwaggerOperationAttribute("Create Flight", "Create Flight")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces() - .Produces(StatusCodes.Status201Created) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status201Created, + "Flight Created", + typeof(FlightResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Flights/Features/DeleteFlight/Endpoints/V1/DeleteFlightEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/DeleteFlight/Endpoints/V1/DeleteFlightEndpoint.cs index 0d3eec5..62cce91 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/DeleteFlight/Endpoints/V1/DeleteFlightEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/DeleteFlight/Endpoints/V1/DeleteFlightEndpoint.cs @@ -11,6 +11,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Flights.Features.DeleteFlight.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class DeleteFlightEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -21,9 +23,21 @@ public class DeleteFlightEndpoint : IMinimalEndpoint .WithName("DeleteFlight") .WithMetadata(new SwaggerOperationAttribute("Delete Flight", "Delete Flight")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces() - .Produces(StatusCodes.Status204NoContent) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status204NoContent, + "Flight Deleted", + typeof(FlightResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Flights/Features/GetAvailableFlights/Endpoints/V1/GetAvailableFlightsEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/GetAvailableFlights/Endpoints/V1/GetAvailableFlightsEndpoint.cs index 9460bed..904e4c4 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/GetAvailableFlights/Endpoints/V1/GetAvailableFlightsEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/GetAvailableFlights/Endpoints/V1/GetAvailableFlightsEndpoint.cs @@ -12,6 +12,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Flights.Features.GetAvailableFlights.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class GetAvailableFlightsEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -22,9 +24,21 @@ public class GetAvailableFlightsEndpoint : IMinimalEndpoint .WithName("GetAvailableFlights") .WithMetadata(new SwaggerOperationAttribute("Get Available Flights", "Get Available Flights")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces>() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "GetAvailableFlights", + typeof(IEnumerable))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Flights/Features/GetFlightById/Endpoints/V1/GetFlightByIdEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/GetFlightById/Endpoints/V1/GetFlightByIdEndpoint.cs index 97ad9c8..b0b075e 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/GetFlightById/Endpoints/V1/GetFlightByIdEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/GetFlightById/Endpoints/V1/GetFlightByIdEndpoint.cs @@ -11,6 +11,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Flights.Features.GetFlightById.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class GetFlightByIdEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -24,6 +26,21 @@ public class GetFlightByIdEndpoint : IMinimalEndpoint .Produces() .Produces(StatusCodes.Status200OK) .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "GetFlightById", + typeof(FlightResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Flights/Features/UpdateFlight/Endpoints/V1/UpdateFlightEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/UpdateFlight/Endpoints/V1/UpdateFlightEndpoint.cs index 5fcd142..505448c 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/UpdateFlight/Endpoints/V1/UpdateFlightEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/UpdateFlight/Endpoints/V1/UpdateFlightEndpoint.cs @@ -13,6 +13,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Flights.Features.UpdateFlight.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class UpdateFlightEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -26,6 +28,21 @@ public class UpdateFlightEndpoint : IMinimalEndpoint .Produces() .Produces(StatusCodes.Status204NoContent) .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status204NoContent, + "Flight Updated", + typeof(FlightResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Seats/Features/CreateSeat/Endpoints/V1/CreateSeatEndpoint.cs b/src/Services/Flight/src/Flight/Seats/Features/CreateSeat/Endpoints/V1/CreateSeatEndpoint.cs index 1f89c8f..beddb94 100644 --- a/src/Services/Flight/src/Flight/Seats/Features/CreateSeat/Endpoints/V1/CreateSeatEndpoint.cs +++ b/src/Services/Flight/src/Flight/Seats/Features/CreateSeat/Endpoints/V1/CreateSeatEndpoint.cs @@ -13,6 +13,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Seats.Features.CreateSeat.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class CreateSeatEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -23,9 +25,21 @@ public class CreateSeatEndpoint : IMinimalEndpoint .WithName("CreateSeat") .WithMetadata(new SwaggerOperationAttribute("Create Seat", "Create Seat")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "Seat Created", + typeof(SeatResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Seats/Features/GetAvailableSeats/Endpoints/V1/GetAvailableSeatsEndpoint.cs b/src/Services/Flight/src/Flight/Seats/Features/GetAvailableSeats/Endpoints/V1/GetAvailableSeatsEndpoint.cs index a0ed013..e569f8e 100644 --- a/src/Services/Flight/src/Flight/Seats/Features/GetAvailableSeats/Endpoints/V1/GetAvailableSeatsEndpoint.cs +++ b/src/Services/Flight/src/Flight/Seats/Features/GetAvailableSeats/Endpoints/V1/GetAvailableSeatsEndpoint.cs @@ -12,6 +12,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Seats.Features.GetAvailableSeats.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class GetAvailableSeatsEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -22,9 +24,21 @@ public class GetAvailableSeatsEndpoint : IMinimalEndpoint .WithName("GetAvailableSeats") .WithMetadata(new SwaggerOperationAttribute("Get Available Seats", "Get Available Seats")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces>() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "GetAvailableSeats", + typeof(IEnumerable))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Flight/src/Flight/Seats/Features/ReserveSeat/Endpoints/V1/ReserveSeatEndpoint.cs b/src/Services/Flight/src/Flight/Seats/Features/ReserveSeat/Endpoints/V1/ReserveSeatEndpoint.cs index ee92753..32ccf2c 100644 --- a/src/Services/Flight/src/Flight/Seats/Features/ReserveSeat/Endpoints/V1/ReserveSeatEndpoint.cs +++ b/src/Services/Flight/src/Flight/Seats/Features/ReserveSeat/Endpoints/V1/ReserveSeatEndpoint.cs @@ -13,6 +13,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Flight.Seats.Features.ReserveSeat.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class ReserveSeatEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -23,9 +25,21 @@ public class ReserveSeatEndpoint : IMinimalEndpoint .WithName("ReserveSeat") .WithMetadata(new SwaggerOperationAttribute("Reserve Seat", "Reserve Seat")) .WithApiVersionSet(endpoints.NewApiVersionSet("Flight").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "ReserveSeat", + typeof(SeatResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Identity/src/Identity/Identity/Features/RegisterNewUser/Endpoints/V1/RegisterNewUserEndpoint.cs b/src/Services/Identity/src/Identity/Identity/Features/RegisterNewUser/Endpoints/V1/RegisterNewUserEndpoint.cs index 37b6b34..5b6c215 100644 --- a/src/Services/Identity/src/Identity/Identity/Features/RegisterNewUser/Endpoints/V1/RegisterNewUserEndpoint.cs +++ b/src/Services/Identity/src/Identity/Identity/Features/RegisterNewUser/Endpoints/V1/RegisterNewUserEndpoint.cs @@ -13,6 +13,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Identity.Identity.Features.RegisterNewUser.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class RegisterNewUserEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -22,9 +24,16 @@ public class RegisterNewUserEndpoint : IMinimalEndpoint .WithName("RegisterUser") .WithMetadata(new SwaggerOperationAttribute("Register User", "Register User")) .WithApiVersionSet(endpoints.NewApiVersionSet("Identity").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "User Registered", + typeof(RegisterNewUserResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Passenger/src/Passenger/Passengers/Features/CompleteRegisterPassenger/Endpoints/V1/CompleteRegisterPassengerEndpoint.cs b/src/Services/Passenger/src/Passenger/Passengers/Features/CompleteRegisterPassenger/Endpoints/V1/CompleteRegisterPassengerEndpoint.cs index 01c04d3..9b02ae4 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Features/CompleteRegisterPassenger/Endpoints/V1/CompleteRegisterPassengerEndpoint.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Features/CompleteRegisterPassenger/Endpoints/V1/CompleteRegisterPassengerEndpoint.cs @@ -11,6 +11,8 @@ using Swashbuckle.AspNetCore.Annotations; namespace Passenger.Passengers.Features.CompleteRegisterPassenger.Endpoints.V1; +using Hellang.Middleware.ProblemDetails; + public class CompleteRegisterPassengerEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -21,9 +23,21 @@ public class CompleteRegisterPassengerEndpoint : IMinimalEndpoint .WithName("CompleteRegisterPassenger") .WithMetadata(new SwaggerOperationAttribute("Complete Register Passenger", "Complete Register Passenger")) .WithApiVersionSet(endpoints.NewApiVersionSet("Passenger").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "Register Passenger Completed", + typeof(PassengerResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints; diff --git a/src/Services/Passenger/src/Passenger/Passengers/Features/GetPassengerById/Endpoints/V1/GetPassengerByIdEndpoint.cs b/src/Services/Passenger/src/Passenger/Passengers/Features/GetPassengerById/Endpoints/V1/GetPassengerByIdEndpoint.cs index b0fddcc..ddbee17 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Features/GetPassengerById/Endpoints/V1/GetPassengerByIdEndpoint.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Features/GetPassengerById/Endpoints/V1/GetPassengerByIdEndpoint.cs @@ -10,6 +10,9 @@ using Passenger.Passengers.Features.GetPassengerById.Queries.V1; using Swashbuckle.AspNetCore.Annotations; namespace Passenger.Passengers.Features.GetPassengerById.Endpoints.V1; + +using Hellang.Middleware.ProblemDetails; + public class GetPassengerByIdEndpoint : IMinimalEndpoint { public IEndpointRouteBuilder MapEndpoint(IEndpointRouteBuilder endpoints) @@ -20,9 +23,21 @@ public class GetPassengerByIdEndpoint : IMinimalEndpoint .WithName("GetPassengerById") .WithMetadata(new SwaggerOperationAttribute("Get Passenger By Id", "Get Passenger By Id")) .WithApiVersionSet(endpoints.NewApiVersionSet("Passenger").Build()) - .Produces() - .Produces(StatusCodes.Status200OK) - .Produces(StatusCodes.Status400BadRequest) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status200OK, + "GetPassengerById", + typeof(PassengerResponseDto))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status400BadRequest, + "BadRequest", + typeof(StatusCodeProblemDetails))) + .WithMetadata( + new SwaggerResponseAttribute( + StatusCodes.Status401Unauthorized, + "UnAuthorized", + typeof(StatusCodeProblemDetails))) .HasApiVersion(1.0); return endpoints;