The ApiCodeGenerator extension module implements code generation for the Refit library.
- Add the
ApiCodeGenerator.OpenApi.Refit
andRefit
packages to your project. - Add a document describing the API (in json or yaml format) and a corresponding nswag file with the same name (format description).
- In the nswag file, select the
OpenApiToRefitClient
generator. - Rebuild the project.
Now, an interface with the name specified in the nswag file (by default, it matches the document file name) will be available in the project.
You can read more about other generation settings in the ApiCodeGenerator project description.