You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure this is a dumb question. I have an openapi spec provided to me. I want to generate the CSharp objects. Trying this:
using NJsonSchema.CodeGeneration.CSharp;varopenapi=await NSwag.OpenApiDocument.FromFileAsync("spec.json");vargenerator=new CSharpGenerator(openapi);varfile= generator.GenerateFile();
Console.WriteLine(file);
But getting:
Unhandled exception. System.InvalidCastException: Unable to cast object of type 'NSwag.OpenApiDocument' to type 'NJsonSchema.JsonSchema'.
at NJsonSchema.CodeGeneration.GeneratorBase.GenerateFile()
The Readme seems to indicate that this is supported (openapi), but what is the recipe to make this happen?
I'm sure this is a dumb question. I have an openapi spec provided to me. I want to generate the CSharp objects. Trying this:
But getting:
The Readme seems to indicate that this is supported (openapi), but what is the recipe to make this happen?
net8.0
with the following packages:The text was updated successfully, but these errors were encountered: