Skip to content

Commit

Permalink
Merge pull request #12 from ddunkin/service-name
Browse files Browse the repository at this point in the history
Fix --service-name
  • Loading branch information
ddunkin authored Aug 23, 2024
2 parents b949f16 + 657809c commit f75cf13
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<VersionPrefix>2.6.1</VersionPrefix>
<PackageValidationBaselineVersion>2.6.0</PackageValidationBaselineVersion>
<VersionPrefix>2.6.2</VersionPrefix>
<PackageValidationBaselineVersion>2.6.1</PackageValidationBaselineVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 2.6.2

* Fix `--service-name`.

## 2.6.1

* Ignore events for now.
Expand Down
12 changes: 7 additions & 5 deletions src/fsdgenswagger/FsdGenSwaggerApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,19 @@ public sealed class FsdGenSwaggerApp : CodeGeneratorApp

protected override FileGeneratorSettings CreateSettings(ArgsReader args)
{
var serviceName = args.ReadOption("service-name");
if (serviceName != null && ServiceDefinitionUtility.IsValidName(serviceName))
throw new ArgsReaderException($"Invalid service name '{serviceName}'.");
m_serviceName = args.ReadOption("service-name");
if (m_serviceName != null && !ServiceDefinitionUtility.IsValidName(m_serviceName))
throw new ArgsReaderException($"Invalid service name '{m_serviceName}'.");

return new SwaggerGeneratorSettings
{
GeneratesFsd = args.ReadFlag("fsd"),
GeneratesJson = args.ReadFlag("json"),
ServiceName = serviceName,
ServiceName = m_serviceName,
};
}

protected override ServiceParser CreateParser() => new SwaggerParser();
protected override ServiceParser CreateParser() => new SwaggerParser { ServiceName = m_serviceName };

private string? m_serviceName;
}

0 comments on commit f75cf13

Please sign in to comment.