Skip to content

Restier Swagger support for AspNetCore : PUT doesn't appears #746

Closed

Description

@RichySano

Swagger is well generated but PUT method doesn't appears in swagger UI. But PUT method is working well with POSTMAN for example.

Assemblies affected

Restier RTM 1.1.0

Program.cs

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRestier(configureApisAction =>
{
configureApisAction.AddRestierApi((routeServices) =>
{
routeServices.AddOptions();
routeServices.AddEFCoreProviderServices((services, options) =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"));
});
});
}, true);

builder.Services.AddRestierSwagger();

var app = builder.Build();

if (app.Environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

app.UseRestierBatching();
app.UseRouting();
app.UseAuthorization();

app.UseEndpoints(endpoints =>
{
_ = endpoints.Select().Expand().Filter().OrderBy().MaxTop(100).Count().SetTimeZoneInfo(TimeZoneInfo.Utc);
_ = endpoints.MapRestier(builder =>
{
builder.MapApiRoute("", "", true);
});
});

app.UseClaimsPrincipals();
app.UseHttpsRedirection();
app.UseRestierSwagger(true);
app.MapControllers();
app.Run();

Activity

  1. DennyFiguerres commented on Nov 29, 2023

    @DennyFiguerres

    we might want to make this a discussion .....
    my prior reads of the OData Standards and the HTTP Verbs i personally feel that HTTP PATCH is a better match in most cases.

    PUT implies that a new entity will fully replace the current entity.
    i have always used HTTP PATCH
    HTTP PATCH is more in line with a SQL UPDATE statement where you only need to update some parts of a current entity.
    where implementing HTTP PUT would be more like a sql delete and then an insert.

    just my thoughts at this point....

  2. locked and limited conversation to collaborators on Nov 29, 2023
  3. converted this issue into a discussion #748 on Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions