proudmonkey / AutoWrapper

A simple, yet customizable global exception handler and Http response wrapper for ASP.NET Core APIs.
MIT License
679 stars 82 forks source link

Update ApiProblemDetails.cs #122

Closed EmreMengukan closed 2 years ago

EmreMengukan commented 2 years ago

internal class to public Method attribute swagger support [ProducesResponseType(typeof(ApiProblemDetails), Status422UnprocessableEntity)]

proudmonkey commented 2 years ago

@EmreMengukan AutoWrapper provides public Models that you can use as type for responses here: https://github.com/proudmonkey/AutoWrapper/tree/master/src/AutoWrapper/Models

EmreMengukan commented 2 years ago

Super :) I have done it using as below

[ProducesResponseType(typeof(ApiResultResponse<TestResponse>), Status200OK)]
[ProducesResponseType(typeof(ApiProblemDetailsValidationErrorResponse), Status422UnprocessableEntity)]
[ProducesResponseType(typeof(ApiProblemDetailsExceptionResponse), StatusCodes.Status500InternalServerError)]
public class TestResponse
{
    public string Name { get; set; }
}

ApiResultResponse.cs file properties StatusCode column not found. should i use this with new ApiResultClass with PropertyAttribute [AutoWrapperPropertyMap(Prop.StatusCode)]

AutoWrapper.Wrappers.ApiResponse it's in it StatusCode

proudmonkey commented 2 years ago

It was my intent not to include StatusCode in the response body as it appears redundant.

EmreMengukan commented 2 years ago

It was my intent not to include StatusCode in the response body as it appears redundant.

thank you for your return