Skip to content

Commit

Permalink
asyncapi#207 generate code from spec: Formatting (again) and test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Senn Geerts authored and Senn Geerts committed Jul 21, 2024
1 parent aed2466 commit b9b7f21
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public async Task<int> FromSpec(params string[] specs)

var specsToGenerate = Split(specs);
var output = await codeGenerator.FromSpecs(specsToGenerate).ConfigureAwait(false);

// Write to file
foreach (var (spec, contents) in output)
{
Expand Down
2 changes: 1 addition & 1 deletion src/AsyncAPI.Saunter.Generator.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
ConsoleApp.LogError = msg => logger.LogError(msg);
ConsoleApp.ServiceProvider = serviceProvider;
logger.LogDebug($"Generator.Cli args: {string.Join(' ', args)}");
//logger.LogDebug($"Generator.Cli args: {string.Join(' ', args)}");

var app = ConsoleApp.Create();
app.Add<ToFileCommand>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<None Include="build/*" Pack="true" PackagePath="/build" />

<!-- Package the generator in the analyzer directory of the nuget package -->
<None Include="$(OutputPath)" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(OutputPath)*" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private static async void GenerateCode(SourceProductionContext context, (Analyze
context.AddSource($"{spec.SpecFileName}.g.cs", contents);
}
}

public static readonly DiagnosticDescriptor MissingNamespace = new(
"AA0001",
"No namespace provided for AsyncAPI code generator",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public string GenerateAsyncApiInterfaces(GeneratorOptions options, AsyncApiDocum

// Events
this.AddInterface(sb, options, options.ClassName, $"{options.ClassName}Events", new("PublishOperation", "evt", x => x.Publish), asyncApiDocument.Channels.Where(x => x.Value.Publish != null));

sb.AppendLine("}"); // close namespace
sb.AppendLine();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using NJsonSchema;
using NSwag.CodeGeneration.CSharp;
using NSwag;
using NJsonSchema.CodeGeneration.CSharp;

using NSwag;
using NSwag.CodeGeneration.CSharp;

namespace AsyncAPI.Saunter.Generator.FromSpec.DataTypes;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Text.Json;
using System.Text.Json.Nodes;
using YamlDotNet.RepresentationModel;
using Yaml2JsonNode;
using YamlDotNet.RepresentationModel;

namespace AsyncAPI.Saunter.Generator.FromSpec.DataTypes;

Expand Down

0 comments on commit b9b7f21

Please sign in to comment.