Skip to content

Commit

Permalink
Merge pull request #5 from bonsai-rx/feature-dev
Browse files Browse the repository at this point in the history
Make schema option required
  • Loading branch information
glopesdev authored Oct 7, 2023
2 parents 761418c + e43a65f commit 30fe4f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Bonsai.Sgen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ internal class Program
{
static async Task Main(string[] args)
{
var schemaPath = new Option<string>(
var schemaPath = new Option<FileInfo>(
name: "--schema",
getDefaultValue: () => "schema.json",
description: "Generates serialization classes for data types in the specified schema file.");
description: "Generates serialization classes for data types in the specified schema file.")
{ IsRequired = true };
var generatorNamespace = new Option<string?>(
name: "--namespace",
getDefaultValue: () => "DataSchema",
Expand Down Expand Up @@ -45,7 +45,7 @@ static async Task Main(string[] args)
rootCommand.AddOption(serializerLibrary);
rootCommand.SetHandler(async (filePath, generatorNamespace, generatorTypeName, outputFilePath, serializerLibrary) =>
{
var schema = await JsonSchema.FromFileAsync(filePath);
var schema = await JsonSchema.FromFileAsync(filePath.FullName);
if (string.IsNullOrEmpty(generatorTypeName))
{
if (!schema.HasTypeNameTitle)
Expand Down

0 comments on commit 30fe4f7

Please sign in to comment.