About this OpenAPI to C# model generator
Generate C# DTO classes or records and enums from an OpenAPI 3.x or Swagger 2.0 specification in JSON or YAML. Types, formats, nullability, required properties, arrays, dictionaries, allOf inheritance and inline objects are mapped to idiomatic C# with optional System.Text.Json attributes.
How to use the OpenAPI to C#
- Paste the OpenAPI or Swagger document.
- Choose classes or records and attributes.
- Generate and copy the code.
Example
{ type: string, format: date-time } → DateTimeOffsetFrequently asked questions
Does it generate API clients?
No, only the model types from the schemas section. Use them with HttpClient and System.Text.Json or a client generator.
Is my data safe?
Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.
Is it free?
Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.