Class RefitGenerator
Generates Refit clients and interfaces based on an OpenAPI specification.
public class RefitGenerator
- Inheritance
-
RefitGenerator
- Inherited Members
Constructors
RefitGenerator(RefitGeneratorSettings, OpenApiDocument)
Generates Refit clients and interfaces based on an OpenAPI specification.
public RefitGenerator(RefitGeneratorSettings settings, OpenApiDocument document)
Parameters
settings
RefitGeneratorSettingsdocument
OpenApiDocument
Properties
OpenApiDocument
OpenAPI specifications used to generate Refit clients and interfaces.
public OpenApiDocument OpenApiDocument { get; }
Property Value
- OpenApiDocument
Methods
CreateAsync(RefitGeneratorSettings)
Creates a new instance of the RefitGenerator class asynchronously.
public static Task<RefitGenerator> CreateAsync(RefitGeneratorSettings settings)
Parameters
settings
RefitGeneratorSettingsThe settings used to configure the generator.
Returns
- Task<RefitGenerator>
A new instance of the RefitGenerator class.
Generate()
Generates Refit clients and interfaces based on an OpenAPI specification and returns the generated code as a string.
public string Generate()
Returns
- string
The generated code as a string.
GenerateMultipleFiles()
Generates multiple files containing Refit interfaces and contracts.
public GeneratorOutput GenerateMultipleFiles()
Returns
- GeneratorOutput
A GeneratorOutput containing all generated code files.