diff --git a/src/Services/Booking/src/Booking/Booking/Features/CreatingBook/Commands/V1/CreateBookingEndpoint.cs b/src/Services/Booking/src/Booking/Booking/Features/CreatingBook/Commands/V1/CreateBookingEndpoint.cs index 0b3b4ef..bff022f 100644 --- a/src/Services/Booking/src/Booking/Booking/Features/CreatingBook/Commands/V1/CreateBookingEndpoint.cs +++ b/src/Services/Booking/src/Booking/Booking/Features/CreatingBook/Commands/V1/CreateBookingEndpoint.cs @@ -6,6 +6,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record CreateBookingRequestDto(Guid PassengerId, Guid FlightId, string Description); @@ -18,10 +19,10 @@ public class CreateBookingEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/booking", CreateBooking) .RequireAuthorization() .WithName("CreateBooking") - .WithMetadata(new SwaggerOperationAttribute("Create Booking", "Create Booking")) .WithApiVersionSet(builder.NewApiVersionSet("Booking").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Create Booking", Description = "Create Booking" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Aircrafts/Features/CreatingAircraft/V1/CreateAircraftEndpoint.cs b/src/Services/Flight/src/Flight/Aircrafts/Features/CreatingAircraft/V1/CreateAircraftEndpoint.cs index 57abf33..33c6fc1 100644 --- a/src/Services/Flight/src/Flight/Aircrafts/Features/CreatingAircraft/V1/CreateAircraftEndpoint.cs +++ b/src/Services/Flight/src/Flight/Aircrafts/Features/CreatingAircraft/V1/CreateAircraftEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record CreateAircraftRequestDto(string Name, string Model, int ManufacturingYear); @@ -21,10 +22,10 @@ public class CreateAircraftEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/flight/aircraft", CreateAircraft) .RequireAuthorization() .WithName("CreateAircraft") - .WithMetadata(new SwaggerOperationAttribute("Create Aircraft", "Create Aircraft")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Create Aircraft", Description = "Create Aircraft" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Airports/Features/CreatingAirport/V1/CreateAirportEndpoint.cs b/src/Services/Flight/src/Flight/Airports/Features/CreatingAirport/V1/CreateAirportEndpoint.cs index 63a54a8..3c8e794 100644 --- a/src/Services/Flight/src/Flight/Airports/Features/CreatingAirport/V1/CreateAirportEndpoint.cs +++ b/src/Services/Flight/src/Flight/Airports/Features/CreatingAirport/V1/CreateAirportEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record CreateAirportRequestDto(string Name, string Address, string Code); @@ -21,10 +22,10 @@ public class CreateAirportEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/flight/airport", CreateAirport) .RequireAuthorization() .WithName("CreateAirport") - .WithMetadata(new SwaggerOperationAttribute("Create Airport", "Create Airport")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Create Airport", Description = "Create Airport" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Flights/Features/CreatingFlight/V1/CreateFlightEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/CreatingFlight/V1/CreateFlightEndpoint.cs index 8bb1d50..11ed558 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/CreatingFlight/V1/CreateFlightEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/CreatingFlight/V1/CreateFlightEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record CreateFlightRequestDto(string FlightNumber, Guid AircraftId, Guid DepartureAirportId, @@ -24,10 +25,10 @@ public class CreateFlightEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/flight", CreateFlight) .RequireAuthorization() .WithName("CreateFlight") - .WithMetadata(new SwaggerOperationAttribute("Create Flight", "Create Flight")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces(StatusCodes.Status201Created) .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Create Flight", Description = "Create Flight" }) .HasApiVersion(1.0); return builder; @@ -42,6 +43,6 @@ public class CreateFlightEndpoint : IMinimalEndpoint var response = new CreateFlightResponseDto(result.Id); - return Results.CreatedAtRoute("GetFlightById", new {id = result.Id}, response); + return Results.CreatedAtRoute("GetFlightById", new { id = result.Id }, response); } } diff --git a/src/Services/Flight/src/Flight/Flights/Features/DeletingFlight/V1/DeleteFlightEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/DeletingFlight/V1/DeleteFlightEndpoint.cs index c0a3d32..4dac6ce 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/DeletingFlight/V1/DeleteFlightEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/DeletingFlight/V1/DeleteFlightEndpoint.cs @@ -8,6 +8,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public class DeleteFlightEndpoint : IMinimalEndpoint @@ -17,10 +18,10 @@ public class DeleteFlightEndpoint : IMinimalEndpoint builder.MapDelete($"{EndpointConfig.BaseApiPath}/flight/{{id}}", DeleteFlight) .RequireAuthorization() .WithName("DeleteFlight") - .WithMetadata(new SwaggerOperationAttribute("Delete Flight", "Delete Flight")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces(StatusCodes.Status204NoContent) .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Delete Flight", Description = "Delete Flight" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Flights/Features/GettingAvailableFlights/V1/GetAvailableFlightsEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/GettingAvailableFlights/V1/GetAvailableFlightsEndpoint.cs index ce8033c..7f20dc3 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/GettingAvailableFlights/V1/GetAvailableFlightsEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/GettingAvailableFlights/V1/GetAvailableFlightsEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record GetAvailableFlightsResponseDto(IEnumerable FlightDtos); @@ -20,10 +21,10 @@ public class GetAvailableFlightsEndpoint : IMinimalEndpoint builder.MapGet($"{EndpointConfig.BaseApiPath}/flight/get-available-flights", GetAvailableFlights) .RequireAuthorization() .WithName("GetAvailableFlights") - .WithMetadata(new SwaggerOperationAttribute("Get Available Flights", "Get Available Flights")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Get Available Flights", Description = "Get Available Flights" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Flights/Features/GettingFlightById/V1/GetFlightByIdEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/GettingFlightById/V1/GetFlightByIdEndpoint.cs index 3e37eb2..aef08ee 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/GettingFlightById/V1/GetFlightByIdEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/GettingFlightById/V1/GetFlightByIdEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record GetFlightByIdResponseDto(FlightDto FlightDto); @@ -20,10 +21,10 @@ public class GetFlightByIdEndpoint : IMinimalEndpoint builder.MapGet($"{EndpointConfig.BaseApiPath}/flight/{{id}}", GetById) .RequireAuthorization() .WithName("GetFlightById") - .WithMetadata(new SwaggerOperationAttribute("Get Flight By Id", "Get Flight By Id")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Get Flight By Id", Description = "Get Flight By Id" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Flights/Features/UpdatingFlight/V1/UpdateFlightEndpoint.cs b/src/Services/Flight/src/Flight/Flights/Features/UpdatingFlight/V1/UpdateFlightEndpoint.cs index e4cdb50..7a2a4ae 100644 --- a/src/Services/Flight/src/Flight/Flights/Features/UpdatingFlight/V1/UpdateFlightEndpoint.cs +++ b/src/Services/Flight/src/Flight/Flights/Features/UpdatingFlight/V1/UpdateFlightEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record UpdateFlightRequestDto(Guid Id, string FlightNumber, Guid AircraftId, Guid DepartureAirportId, DateTime DepartureDate, DateTime ArriveDate, @@ -21,10 +22,10 @@ public class UpdateFlightEndpoint : IMinimalEndpoint builder.MapPut($"{EndpointConfig.BaseApiPath}/flight", UpdateFlight) .RequireAuthorization() .WithName("UpdateFlight") - .WithMetadata(new SwaggerOperationAttribute("Update Flight", "Update Flight")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces(StatusCodes.Status204NoContent) .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Update Flight", Description = "Update Flight" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Seats/Features/CreatingSeat/V1/CreateSeatEndpoint.cs b/src/Services/Flight/src/Flight/Seats/Features/CreatingSeat/V1/CreateSeatEndpoint.cs index fdccb07..98dcf0e 100644 --- a/src/Services/Flight/src/Flight/Seats/Features/CreatingSeat/V1/CreateSeatEndpoint.cs +++ b/src/Services/Flight/src/Flight/Seats/Features/CreatingSeat/V1/CreateSeatEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record CreateSeatRequestDto(string SeatNumber, Enums.SeatType Type, Enums.SeatClass Class, Guid FlightId); @@ -21,10 +22,10 @@ public class CreateSeatEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/flight/seat", CreateSeat) .RequireAuthorization() .WithName("CreateSeat") - .WithMetadata(new SwaggerOperationAttribute("Create Seat", "Create Seat")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Create Seat", Description = "Create Seat" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Seats/Features/GettingAvailableSeats/V1/GetAvailableSeatsEndpoint.cs b/src/Services/Flight/src/Flight/Seats/Features/GettingAvailableSeats/V1/GetAvailableSeatsEndpoint.cs index bd4f15c..f5b2002 100644 --- a/src/Services/Flight/src/Flight/Seats/Features/GettingAvailableSeats/V1/GetAvailableSeatsEndpoint.cs +++ b/src/Services/Flight/src/Flight/Seats/Features/GettingAvailableSeats/V1/GetAvailableSeatsEndpoint.cs @@ -10,6 +10,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record GetAvailableSeatsResponseDto(IEnumerable SeatDtos); @@ -21,10 +22,10 @@ public class GetAvailableSeatsEndpoint : IMinimalEndpoint builder.MapGet($"{EndpointConfig.BaseApiPath}/flight/get-available-seats/{{id}}", GetAvailableSeats) .RequireAuthorization() .WithName("GetAvailableSeats") - .WithMetadata(new SwaggerOperationAttribute("Get Available Seats", "Get Available Seats")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Get Available Seats", Description = "Get Available Seats" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Flight/src/Flight/Seats/Features/ReservingSeat/Commands/V1/ReserveSeatEndpoint.cs b/src/Services/Flight/src/Flight/Seats/Features/ReservingSeat/Commands/V1/ReserveSeatEndpoint.cs index 766b3fb..0b8c262 100644 --- a/src/Services/Flight/src/Flight/Seats/Features/ReservingSeat/Commands/V1/ReserveSeatEndpoint.cs +++ b/src/Services/Flight/src/Flight/Seats/Features/ReservingSeat/Commands/V1/ReserveSeatEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record ReserveSeatRequestDto(Guid FlightId, string SeatNumber); @@ -21,10 +22,10 @@ public class ReserveSeatEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/flight/reserve-seat", ReserveSeat) .RequireAuthorization() .WithName("ReserveSeat") - .WithMetadata(new SwaggerOperationAttribute("Reserve Seat", "Reserve Seat")) .WithApiVersionSet(builder.NewApiVersionSet("Flight").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Reserve Seat", Description = "Reserve Seat" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Identity/src/Identity/Identity/Features/RegisteringNewUser/V1/RegisterNewUserEndpoint.cs b/src/Services/Identity/src/Identity/Identity/Features/RegisteringNewUser/V1/RegisterNewUserEndpoint.cs index a3b11ca..d3aa53e 100644 --- a/src/Services/Identity/src/Identity/Identity/Features/RegisteringNewUser/V1/RegisterNewUserEndpoint.cs +++ b/src/Services/Identity/src/Identity/Identity/Features/RegisteringNewUser/V1/RegisterNewUserEndpoint.cs @@ -9,6 +9,7 @@ using MediatR; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record RegisterNewUserRequestDto(string FirstName, string LastName, string Username, string Email, @@ -22,10 +23,10 @@ public class RegisterNewUserEndpoint : IMinimalEndpoint { builder.MapPost($"{EndpointConfig.BaseApiPath}/identity/register-user", RegisterNewUser) .WithName("RegisterUser") - .WithMetadata(new SwaggerOperationAttribute("Register User", "Register User")) .WithApiVersionSet(builder.NewApiVersionSet("Identity").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Register User", Description = "Register User" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Passenger/src/Passenger/Passengers/Features/CompletingRegisterPassenger/V1/CompleteRegisterPassengerEndpoint.cs b/src/Services/Passenger/src/Passenger/Passengers/Features/CompletingRegisterPassenger/V1/CompleteRegisterPassengerEndpoint.cs index 7a02e4f..dfe1d92 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Features/CompletingRegisterPassenger/V1/CompleteRegisterPassengerEndpoint.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Features/CompletingRegisterPassenger/V1/CompleteRegisterPassengerEndpoint.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Dtos; -using Swashbuckle.AspNetCore.Annotations; +using Microsoft.OpenApi.Models; public record CompleteRegisterPassengerRequestDto(string PassportNumber, Enums.PassengerType PassengerType, int Age); public record CompleteRegisterPassengerResponseDto(PassengerDto PassengerDto); @@ -19,10 +19,10 @@ public class CompleteRegisterPassengerEndpoint : IMinimalEndpoint builder.MapPost($"{EndpointConfig.BaseApiPath}/passenger/complete-registration", CompleteRegisterPassenger) .RequireAuthorization() .WithName("CompleteRegisterPassenger") - .WithMetadata(new SwaggerOperationAttribute("Complete Register Passenger", "Complete Register Passenger")) .WithApiVersionSet(builder.NewApiVersionSet("Passenger").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Complete Register Passenger", Description = "Complete Register Passenger" }) .HasApiVersion(1.0); return builder; diff --git a/src/Services/Passenger/src/Passenger/Passengers/Features/GettingPassengerById/Queries/V1/GetPassengerByIdEndpoint.cs b/src/Services/Passenger/src/Passenger/Passengers/Features/GettingPassengerById/Queries/V1/GetPassengerByIdEndpoint.cs index 79cb838..d48b429 100644 --- a/src/Services/Passenger/src/Passenger/Passengers/Features/GettingPassengerById/Queries/V1/GetPassengerByIdEndpoint.cs +++ b/src/Services/Passenger/src/Passenger/Passengers/Features/GettingPassengerById/Queries/V1/GetPassengerByIdEndpoint.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Dtos; +using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.Annotations; public record GetPassengerByIdResponseDto(PassengerDto PassengerDto); @@ -17,10 +18,10 @@ public class GetPassengerByIdEndpoint : IMinimalEndpoint builder.MapGet($"{EndpointConfig.BaseApiPath}/passenger/{{id}}", GetById) .RequireAuthorization() .WithName("GetPassengerById") - .WithMetadata(new SwaggerOperationAttribute("Get Passenger By Id", "Get Passenger By Id")) .WithApiVersionSet(builder.NewApiVersionSet("Passenger").Build()) .Produces() .ProducesProblem(StatusCodes.Status400BadRequest) + .WithOpenApi(operation => new OpenApiOperation(operation) { Summary = "Get Passenger By Id", Description = "Get Passenger By Id" }) .HasApiVersion(1.0); return builder;