SchemaRepositoryExtensions Class
HAKOM.ErrorHandling.Http.Net.Api.Extensions
Section titled “HAKOM.ErrorHandling.Http.Net.Api.Extensions”Provides extension methods to make OpenApi schemas used for error handling available to custom operation filters, etc.
public static class SchemaRepositoryExtensionsInheritance System.Object 🡒 SchemaRepositoryExtensions
Methods
Section titled “Methods”SchemaRepositoryExtensions.GetFailureSchema(this SchemaRepository, ISchemaGenerator) Method
Section titled “SchemaRepositoryExtensions.GetFailureSchema(this SchemaRepository, ISchemaGenerator) Method”Returns the OpenAPI schema for Failure objects.
public static Microsoft.OpenApi.Models.OpenApiSchema GetFailureSchema(this Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository schemaRepository, Swashbuckle.AspNetCore.SwaggerGen.ISchemaGenerator generator);Parameters
Section titled “Parameters”schemaRepository Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository
The repository of the current generation context.
generator Swashbuckle.AspNetCore.SwaggerGen.ISchemaGenerator
The generator for the current generation context.
Returns
Section titled “Returns”Microsoft.OpenApi.Models.OpenApiSchema
The schema for objects of type Failure.
SchemaRepositoryExtensions.TryGetProblemDetailsSchema(this SchemaRepository, OpenApiSchema) Method
Section titled “SchemaRepositoryExtensions.TryGetProblemDetailsSchema(this SchemaRepository, OpenApiSchema) Method”Attempts to get the schema for problem details objects to be used in custom error responses.
public static bool TryGetProblemDetailsSchema(this Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository schemaRepository, out Microsoft.OpenApi.Models.OpenApiSchema schema);Parameters
Section titled “Parameters”schemaRepository Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository
The schema repository from which to get the schema.
schema Microsoft.OpenApi.Models.OpenApiSchema
If successful, the schema for problem details objects that should be returned when an error occurs.
Returns
Section titled “Returns”System.Boolean
true if the schema was found, false otherwise.