Skip to content
Documentation

SchemaRepositoryExtensions Class

Provides extension methods to make OpenApi schemas used for error handling available to custom operation filters, etc.

public static class SchemaRepositoryExtensions

Inheritance System.Object 🡒 SchemaRepositoryExtensions

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);

schemaRepository Swashbuckle.AspNetCore.SwaggerGen.SchemaRepository

The repository of the current generation context.

generator Swashbuckle.AspNetCore.SwaggerGen.ISchemaGenerator

The generator for the current generation context.

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);

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.

System.Boolean
true if the schema was found, false otherwise.

© 2026 Volue.Version v0.6.38017 November 2026