Skip to content

Commit

Permalink
fix: Fixed Cli generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Jun 15, 2024
1 parent bc4963e commit 5e50332
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/libs/OpenApiGenerator.Cli/Commands/GenerateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,16 @@ private static async Task HandleAsync(
GenerateSdk: true
);

var (models, methods, _, _, _) = Data.Prepare((yaml, settings));
var files = models
.Select(x => Data.GetSourceCode(x)).Concat(methods
.Select(x => Data.GetSourceCode(x)))
var data = Data.Prepare((yaml, settings));
var files = data.Models
.SelectMany(x => new [] { Sources.Model(x), Sources.EnumJsonConverter(x), Sources.EnumNullableJsonConverter(x) })
.Concat(data.Methods
.Select(x => Sources.Method(x)))
.Concat(data.AnyOfs
.SelectMany(x => new [] { Sources.AnyOf(x), Sources.AnyOfJsonConverter(x), Sources.AnyOfJsonConverterFactory(x) }))
.Concat([Sources.JsonSerializerContextTypes(data.Types)])
.Concat([Sources.JsonSerializerContextConverters(data.Converters)])
.Where(x => !x.IsEmpty)
.ToArray();

if (generateAsSingleFile)
Expand Down

0 comments on commit 5e50332

Please sign in to comment.