v1.2.0
What's New
- Generate Apizr flavored Refit interfaces
- Option to wrap multiple query parameters into a single complex one
- Option to only generate contracts (no Refit interfaces)
Installation
This is packaged as a .NET Tool and is published to nuget.org. You can install this specific version of this tool like this:
dotnet tool install --global Refitter --version 1.2.0
Features
- Generate single file containing Refit interface and contract types from an OpenAPI spec file
- Supports OpenAPI v2 and v3
- Supports OpenAPI specifications in JSON and YAML formats
- Supports OpenAPI specification validation and error/warning/stats reporting
- Supports generating route, query, header, and body request parameters
- Generate code at build time using rosyln C# source generator Refitter.SourceGenerator
--no-auto-generated-header
CLI tool argument to skip prefixing output file with header--interface-only
CLI tool argument to skip contract type generation--use-api-response
CLI Tool argument to returnIApiResponse<T>
instead ofTask<T>
--internal
CLI tool argument to generate types with theinternal
accessibility modifier--cancellation-tokens
CLI tool argument to generate the Refit interface with CancellationTokens--no-operation-headers
CLI tool argument to skip generating[Header]
parameters--no-logging
CLI tool argument to disable error logging and feature usage tracking--use-iso-date-format
CLI tool argument to explicitly format date query string parameters in ISO standard date format using delimiters (2023-06-15)--multiple-interfaces
CLI tool argument to generate a Refit interface for each endpoint. This may be eitherByEndpoint
orByTag
--settings-file
CLI tool argument to use a .refitter format file and override all other arguments--skip-validation
CLI tool argument to ignore all validation errors and attempt to generate code anyway--match-path
CLI tool argument to only include Paths that match the provided regular expression. May be set multiple times--tag
CLI tool argument to only include Endpoints that contain this tag. May be set multiple times and result in OR'ed evaluation--optional-nullable-parameters
CLI tool argument to make non-required query parameters to optional parameters in Refit interface--operation-name-template
CLI tool argument to append a prefix or suffix to the{operationName}
template. This can also be used to customize the Execute() method name in the interfaces generated when--multiple-interfaces ByEndpoint
is set--trim-unused-schema
CLI tool argument to remove unreferenced components schema to keep the generated output to a minimum--keep-schema
CLI tool argument to specify a collection of regular expressions to force to keep matching schema. This is used together with--trim-unused-schema
--skip-default-additional-properties
CLI tool argument to skip default additional properties--operation-name-generator
CLI tool argument to NSwag IOperationNameGenerator implementation to use.--use-observable-response
CLI tool argument to returnIObservable<T>
--use-apizr
CLI tool argument to generate Apizr specific Refit interfaces and configuration code--use-dynamic-querystring-parameters
CLI tool argument to wrap multiple query parameters into a single complex one--contract-only
CLI tool to only generate contracts/models without any Refit interfaces
What's Changed
- Add the possibility to generate all the Apizr goodness by @JeremyBP in #428
- [Apizr] Generate Apizr formatted Refit interface without .refitter settings file by @JeremyBP in #430
- [Apizr] Including an xml doc param for ApizrRequestOptions parameter by @JeremyBP in #431
- [Apizr] Docs updated about Apizr integration by @JeremyBP in #432
- Update dependency OasReader to v1.6.16.15 by @renovate in #434
- [Query] Dynamic Querystring Parameters implemented by @JeremyBP in #435
- Added GenerateClients options for seperate generation by @berkslv in #436
- docs: add @bastiennoel93 as a contributor for bug by @allcontributors in #425
- docs: add @MeikelLP as a contributor for ideas by @allcontributors in #426
- docs: add @JeremyBP as a contributor for code by @allcontributors in #429
- docs: add @JeremyBP as a contributor for doc by @allcontributors in #433
- docs: add @berkslv as a contributor for ideas, and code by @allcontributors in #437
New Contributors
Full Changelog: 1.1.3...1.2.0