Skip to content

Releases: Nikcio-labs/openapi-code-generator

Version 1.0.0

21 Feb 15:13
18d4157

Choose a tag to compare

OpenAPI Code Generator v1.0.0

The first stable release of OpenAPI Code Generator — a fast, opinionated C# code generator for OpenAPI 3.x specifications.

What is it?

OpenAPI Code Generator transforms OpenAPI 3.x specs (JSON or YAML) into clean, modern C# code, generating record types, enums, and type aliases with full nullable reference type support and System.Text.Json serialization out of the box — with zero runtime dependencies on the generated code.

Highlights

  • Modern C# output — Generates record types with init-only properties
  • String enums[JsonStringEnumConverter]-backed enums with [JsonStringEnumMemberName] attributes
  • Nullable reference types — Full #nullable enable support throughout generated output
  • Immutable collectionsIReadOnlyList<T> and IReadOnlyDictionary<string, T> by default
  • Composition support — Handles allOf, oneOf, and anyOf schemas
  • URL input — Fetch and generate directly from remote OpenAPI specs
  • XML doc comments — Generated from OpenAPI description fields
  • Configurable — Namespace, mutability, nullability, default values, and more

Installation

dotnet tool install --global Nikcio.OpenApiCodeGen

Quick Start

# From a local file
openapi-codegen petstore.yaml -o Models.cs

# From a remote URL with a custom namespace
openapi-codegen https://petstore3.swagger.io/api/v3/openapi.json -o PetStore.cs -n MyApp.Models

Documentation

Full documentation is available at nikcio-labs.github.io/openapi-code-generator

Version 1.0.0-preview001

21 Feb 14:39
327de61

Choose a tag to compare

Pre-release

Initial preview