diff --git a/tools/Beef.CodeGen.Core/Beef.CodeGen.Core.csproj b/tools/Beef.CodeGen.Core/Beef.CodeGen.Core.csproj index de09d1916..e2ab39d75 100644 --- a/tools/Beef.CodeGen.Core/Beef.CodeGen.Core.csproj +++ b/tools/Beef.CodeGen.Core/Beef.CodeGen.Core.csproj @@ -4,7 +4,7 @@ Exe netcoreapp3.1 Beef.CodeGen - 4.1.3 + 4.1.4 false diff --git a/tools/Beef.CodeGen.Core/CHANGELOG.md b/tools/Beef.CodeGen.Core/CHANGELOG.md index 9dc200b62..c4d1f0056 100644 --- a/tools/Beef.CodeGen.Core/CHANGELOG.md +++ b/tools/Beef.CodeGen.Core/CHANGELOG.md @@ -2,6 +2,9 @@ Represents the **NuGet** versions. +## v4.1.4 +- *Fixed*: Issue [74](https://github.com/Avanade/Beef/issues/74) fixed. There was an additional issue where the value was set to `false` it in turn resulted in `Authorize` versus `AllowAnonymous` which has been corrected. + ## v4.1.3 - *Fixed*: Issue [74](https://github.com/Avanade/Beef/issues/74) fixed. `WebApiAuthorize` attribute was honouring previous override sideeffect. Changed attribute configuration from a `bool` to a `string`. Code-gen will output the supplied value as-is. XML boolean values are automatically converted. _Note:_ the XML Schema and corresponding documentation have not been updated; this will occur during a future release. diff --git a/tools/Beef.CodeGen.Core/CodeGenConsole.cs b/tools/Beef.CodeGen.Core/CodeGenConsole.cs index 0692220c4..600536ade 100644 --- a/tools/Beef.CodeGen.Core/CodeGenConsole.cs +++ b/tools/Beef.CodeGen.Core/CodeGenConsole.cs @@ -74,7 +74,7 @@ private CodeGenConsole() _expectNoChange = App.Option("--expectNoChanges", "Expect no changes in the output and error where changes are detected (e.g. within build pipeline).", CommandOptionType.NoValue); - _logger = Logger.Default ?? new ColoredConsoleLogger(nameof(CodeGenConsole)); + _logger = Logger.Default == null ? Logger.Default = new ColoredConsoleLogger(nameof(CodeGenConsole)) : Logger.Default; App.OnExecuteAsync(async (_) => { @@ -126,6 +126,9 @@ public async Task RunAsync(string[] args) catch (CommandParsingException cpex) { _logger.LogError(cpex.Message); + if (cpex.InnerException != null) + _logger.LogError(cpex.InnerException.Message); + return -1; } } diff --git a/tools/Beef.CodeGen.Core/Config/XmlJsonRename.cs b/tools/Beef.CodeGen.Core/Config/XmlJsonRename.cs index e28a3ebfd..be9133be3 100644 --- a/tools/Beef.CodeGen.Core/Config/XmlJsonRename.cs +++ b/tools/Beef.CodeGen.Core/Config/XmlJsonRename.cs @@ -54,10 +54,10 @@ public static class XmlJsonRename private static readonly List<(ConfigurationEntity Entity, string XmlName, Func Converter)> _xmlToJsonConvert = new List<(ConfigurationEntity, string, Func)>(new (ConfigurationEntity, string, Func)[] { - (ConfigurationEntity.CodeGen, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "Authorize" : xml))), + (ConfigurationEntity.CodeGen, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "AllowAnonymous" : xml))), (ConfigurationEntity.Entity, "ExcludeData", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Yes" : "Mapper")), - (ConfigurationEntity.Entity, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "Authorize" : xml))), - (ConfigurationEntity.Operation, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "Authorize" : xml))) + (ConfigurationEntity.Entity, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "AllowAnonymous" : xml))), + (ConfigurationEntity.Operation, "WebApiAuthorize", (xml) => string.IsNullOrEmpty(xml) ? null : (xml == "true" ? "Authorize" : (xml == "false" ? "AllowAnonymous" : xml))) }); ///