You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is informative for frontend to know what response codes each endpoint can give.
Business Value / Developer Experience
Example: POST api/onboarded-contexts
Response codes:
Name
Description
201 Created
Created
401 Unauthorized
User not authorized to create
403 Forbidden
User not authorized to create
409 Conflict
Context already exist
404 NotFound
Context type not found
Snipped from fusion core:
using Fusion.AspNetCore.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Fusion.Services.Core.AspNetCore;
public class FusionProducesOkResponseTypeAttribute() : ProducesResponseTypeAttribute(StatusCodes.Status200OK);
public class FusionProducesCreatedResponseTypeAttribute() : ProducesResponseTypeAttribute(StatusCodes.Status201Created);
public class FusionProducesAcceptedResponseTypeAttribute() : ProducesResponseTypeAttribute(StatusCodes.Status202Accepted);
public class FusionProducesNoContentResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(void), StatusCodes.Status204NoContent);
public class FusionProducesBadRequestResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest);
public class FusionProducesUnauthorizedResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(void), StatusCodes.Status401Unauthorized);
public class FusionProducesForbiddenResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(FusionForbiddenResponse), StatusCodes.Status403Forbidden);
public class FusionProducesNotFoundResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ProblemDetails), StatusCodes.Status404NotFound);
public class FusionProducesConflictResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ProblemDetails), StatusCodes.Status409Conflict);
public class FusionProducesFailedDependencyResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ProblemDetails), StatusCodes.Status424FailedDependency);
User Acceptance Tests (UAT)
NA
Environments
All testing of issues are done in project-portal-test
Jossilainen
changed the title
Add response codes to all endpoints, so that these are listed in swagger for each endpoint
Add response codes to all endpoints, so that these are listed in swagger
Feb 21, 2024
Expected outcome
It is informative for frontend to know what response codes each endpoint can give.
Business Value / Developer Experience
Example: POST api/onboarded-contexts
Response codes:
Snipped from fusion core:
using Fusion.AspNetCore.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Fusion.Services.Core.AspNetCore;
public class FusionProducesOkResponseTypeAttribute() : ProducesResponseTypeAttribute(StatusCodes.Status200OK);
public class FusionProducesCreatedResponseTypeAttribute() : ProducesResponseTypeAttribute(StatusCodes.Status201Created);
public class FusionProducesAcceptedResponseTypeAttribute() : ProducesResponseTypeAttribute(StatusCodes.Status202Accepted);
public class FusionProducesNoContentResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(void), StatusCodes.Status204NoContent);
public class FusionProducesBadRequestResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest);
public class FusionProducesUnauthorizedResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(void), StatusCodes.Status401Unauthorized);
public class FusionProducesForbiddenResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(FusionForbiddenResponse), StatusCodes.Status403Forbidden);
public class FusionProducesNotFoundResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ProblemDetails), StatusCodes.Status404NotFound);
public class FusionProducesConflictResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ProblemDetails), StatusCodes.Status409Conflict);
public class FusionProducesFailedDependencyResponseTypeAttribute() : ProducesResponseTypeAttribute(typeof(ProblemDetails), StatusCodes.Status424FailedDependency);
User Acceptance Tests (UAT)
NA
Environments
All testing of issues are done in project-portal-test
For Backend use these
The text was updated successfully, but these errors were encountered: