Athy .NET code-generator

OpenAPI spec in, .NET Web API solution out.

Archived showcase. Built 2020–2023 as part of Athy Labs, before ChatGPT and AI coding assistants were part of everyday development. It shows one way to generate .NET services from an OpenAPI spec using dotnet new templates and Roslyn. The tool is still on NuGet but no longer maintained.

The story behind it · Lilly Labs

What is this?

This is a code generator tool for .NET projects. It wraps the dotnet new custom template API. The tool maps an OpenAPI spec onto a templated user solution. You as the user are therefore in control of the generated output.

How to use this tool

Pre-requisites:

Install the tool (don’t worry you can easily uninstall it).

generator cli SDK selection

How does the tool work?

Okay assuming your code generated successfully, you may be wondering how it works and how to use it going forward.

The short version: it rewrites the dotnet new template from the spec (one controller method per endpoint), then runs it. The longer version is in this write-up on Athy Labs.

Why use this tool?

Well, why use any code-generator? If you’re new to the space, this type of tool can be useful if:

Or some combo of the above, and:

Comparison with other code-generator tools

If you’re really interested (bored) I wrote some notes comparing other code-generator tools over here

Known issues

Conclusion

Well I guess let me know if you’d actually use this tool (haha) and I could fix up some of the bugs / add some missing functionality, or you know, just go use ChatGPT.