Skip to content

Commit

Permalink
Provide option to skip generating models
Browse files Browse the repository at this point in the history
  • Loading branch information
Noor Drummond committed Aug 21, 2024
1 parent 48c5abe commit 02b98db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/N3O.Tool/Commands/Clients/ClientsCommand.CSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private async Task GenerateCSharpClientAsync() {
settings.ClassName = Name;
settings.ExposeJsonSerializerSettings = true;
settings.GenerateClientInterfaces = true;
settings.GenerateDtoTypes = true;
settings.GenerateDtoTypes = GenerateModels;
settings.CSharpGeneratorSettings.GenerateOptionalPropertiesAsNullable = true;

settings.CSharpGeneratorSettings.Namespace = Namespace;
Expand Down
3 changes: 3 additions & 0 deletions src/N3O.Tool/Commands/Clients/ClientsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ private async Task<OpenApiDocument> GetOpenApiDocumentAsync() {

return openApiDocument;
}

[Option("--generate-models", Description = "Specify whether models should be generated or not", ShowInHelpText = true)]
public bool GenerateModels { get; set; } = true;

[Option("--language", Description = "The language of the client, must be one of typescript|csharp", ShowInHelpText = true)]
[Required]
Expand Down

0 comments on commit 02b98db

Please sign in to comment.