Class SchemaCleaner
- Namespace
- Refitter.Core
- Assembly
- Refitter.Core.dll
Cleans up the OpenAPI schema by removing unreferenced schemas and handling inheritance hierarchies.
public class SchemaCleaner
- Inheritance
-
SchemaCleaner
- Inherited Members
Constructors
SchemaCleaner(OpenApiDocument, string[])
Initializes a new instance of the SchemaCleaner class.
public SchemaCleaner(OpenApiDocument document, string[] keepSchemaPatterns)
Parameters
documentOpenApiDocumentThe OpenAPI document to clean.
keepSchemaPatternsstring[]Regular expression patterns for schemas to keep.
Properties
IncludeInheritanceHierarchy
Gets or sets a value indicating whether to include inheritance hierarchy in the schema cleaning process.
public bool IncludeInheritanceHierarchy { get; init; }
Property Value
Methods
RemoveUnreferencedSchema()
Removes unreferenced schemas and discriminator mappings from the OpenAPI document. Mappings remain when their targets are otherwise reachable or inheritance inclusion is enabled.
public void RemoveUnreferencedSchema()