You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#3053 Fix by using custom bool parsing that if a string is found then… (#3054)
… it uses the environment replacement and looks for a true false 1 or 0.
## Why make this change?
Fixes#3053
Boolean values can't be set using environment variables. This allows
that
## What is this change?
Using custom JsonConverter for bools that if a string is detected it
uses the string serialiser that uses the environment replacement rules.
## How was this tested?
- [ ] Integration Tests
- [x] Unit Tests
---------
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Jerry Nixon <[email protected]>
Co-authored-by: Aniruddh Munde <[email protected]>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+31-6Lines changed: 31 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@ We use `dotnet format` to enforce code conventions. It is run automatically in C
95
95
96
96
#### Enforcing code style with git hooks
97
97
98
-
You can copy paste the following commands to install a git pre-commit hook. This will cause a commit to fail if you forgot to run `dotnet format`. If you have run on save enabled in your editor this is not necessary.
98
+
You can copy paste the following commands to install a git pre-commit hook (creates a pre-commit file in your .git folder, which isn't shown in vs code). This will cause a commit to fail if you forgot to run `dotnet format`. If you have run on save enabled in your editor this is not necessary.
99
99
100
100
```bash
101
101
cat > .git/hooks/pre-commit <<__EOF__
@@ -112,17 +112,42 @@ if [ "\$(get_files)" = '' ]; then
112
112
fi
113
113
114
114
get_files |
115
-
xargs dotnet format src/Azure.DataApiBuilder.Service.sln \\
Copy file name to clipboardExpand all lines: src/Service.Tests/Caching/CachingConfigProcessingTests.cs
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -161,8 +161,6 @@ public void GlobalCacheOptionsDeserialization_ValidValues(
161
161
[DataRow(@",""cache"": { ""enabled"": true, ""ttl-seconds"": 0 }",DisplayName="EntityCacheOptions.TtlSeconds set to zero is invalid configuration.")]
162
162
[DataRow(@",""cache"": { ""enabled"": true, ""ttl-seconds"": -1 }",DisplayName="EntityCacheOptions.TtlSeconds set to negative number is invalid configuration.")]
163
163
[DataRow(@",""cache"": { ""enabled"": true, ""ttl-seconds"": 1.1 }",DisplayName="EntityCacheOptions.TtlSeconds set to decimal is invalid configuration.")]
164
-
[DataRow(@",""cache"": { ""enabled"": 1 }",DisplayName="EntityCacheOptions.Enabled property set to 1 should fail because not a boolean.")]
165
-
[DataRow(@",""cache"": { ""enabled"": 0 }",DisplayName="EntityCacheOptions.Enabled property set to 0 should fail because not a boolean.")]
166
164
[DataRow(@",""cache"": 1",DisplayName="EntityCacheOptions property set to 1 should fail because it's not a JSON object.")]
167
165
[DataRow(@",""cache"": 0",DisplayName="EntityCacheOptions property set to 0 should fail because it's not a JSON object.")]
168
166
[DataRow(@",""cache"": true",DisplayName="EntityCacheOptions property set to true should fail because it's not a JSON object.")]
Assert.AreEqual("",String.Join('\n',result.ValidationErrors?.Select(s =>$"{s.Message} at {s.Path}{s.LineNumber}{s.LinePosition}")??[]),"Expected no validation errors.");
Assert.AreEqual("",String.Join('\n',result.ValidationErrors?.Select(s =>$"{s.Message} at {s.Path}{s.LineNumber}{s.LinePosition}")??[]),"Expected no validation errors.");
1897
+
1898
+
Assert.IsTrue(EnumerableUtilities.IsNullOrEmpty(result.ValidationErrors),"Validation Erros null of empty");
1899
+
1900
+
Assert.IsTrue(result.IsValid,"Result should be valid");
1825
1901
schemaValidatorLogger.Verify(
1826
1902
x =>x.Log(
1827
1903
LogLevel.Information,
@@ -3368,7 +3444,7 @@ public async Task ValidateStrictModeAsDefaultForRestRequestBody(bool includeExtr
0 commit comments