Skip to content

Bump Newtonsoft.json from 9.0.1 to 13.0.1#30

Merged
lupino3 merged 3 commits intomainfrom
dependabot/nuget/Newtonsoft.json-13.0.1
Jul 5, 2022
Merged

Bump Newtonsoft.json from 9.0.1 to 13.0.1#30
lupino3 merged 3 commits intomainfrom
dependabot/nuget/Newtonsoft.json-13.0.1

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot bot commented on behalf of github Jun 22, 2022

Bumps Newtonsoft.json from 9.0.1 to 13.0.1.

Release notes

Sourced from Newtonsoft.json's releases.

13.0.1

  • New feature - Add JsonSelectSettings with configuration for a regex timeout
  • Change - Remove portable assemblies from NuGet package
  • Change - JsonReader and JsonSerializer MaxDepth defaults to 64
  • Fix - Fixed throwing missing member error on ignored fields
  • Fix - Fixed various nullable annotations
  • Fix - Fixed annotations not being copied when tokens are cloned
  • Fix - Fixed naming strategy not being used when deserializing dictionary enum keys
  • Fix - Fixed serializing nullable struct dictionaries
  • Fix - Fixed JsonWriter.WriteToken to allow null with string token
  • Fix - Fixed missing error when deserializing JToken with a contract type mismatch
  • Fix - Fixed JTokenWriter when writing comment to an object

12.0.3

  • New feature - Added support for nullable reference types
  • New feature - Added KebabCaseNamingStrategy
  • Change - Package now uses embedded package icon
  • Fix - Fixed bug when merging JToken with itself
  • Fix - Fixed performance of calling ICustomTypeDescriptor.GetProperties
  • Fix - Fixed serializing Enumerable.Empty and empty arrays on .NET Core 3.0
  • Fix - Fixed deserializing some collection types with constructor
  • Fix - Fixed deserializing IImmutableSet to ImmutableHashSet instead of ImmutableSortedSet
  • Fix - Fixed deserializing IImmutableDictionary to ImmutableDictionary instead of ImmutableSortedDictionary
  • Fix - Fixed deserializing into constructors with more than 256 parameters
  • Fix - Fixed hang when deserializing JTokenReader with preceding comment
  • Fix - Fixed JSONPath scanning with nested indexer
  • Fix - Fixed deserializing incomplete JSON object to JObject
  • Fix - Fixed using StringEnumConverter with naming strategy and specified values

12.0.2

  • New feature - Added MissingMemberHandling to JsonObjectAttribute and JsonObjectContract
  • New feature - Added constructor to JTokenReader to specify initial path
  • New feature - Added JsonProperty.IsRequiredSpecified
  • New feature - Added JsonContract.InternalConverter
  • Change - Moved embedded debug symbols in NuGet package to a symbol package on NuGet.org
  • Fix - Fixed deserializing nullable struct collections
  • Fix - Fixed memory link when serializing enums to named values
  • Fix - Fixed error when setting JsonLoadSettings.DuplicatePropertyNameHandling to Replace

12.0.1

  • New feature - Added NuGet package signing
  • New feature - Added Authenticode assembly signing
  • New feature - Added SourceLink support
  • New feature - Added constructors to StringEnumConverter for setting AllowIntegerValue
  • New feature - Added JsonNameTable and JsonTextReader.PropertyNameTable
  • New feature - Added line information to JsonSerializationException
  • New feature - Added JObject.Property overload with a StringComparison
  • New feature - Added JsonMergeSettings.PropertyNameComparison
  • New feature - Added support for multiple Date constructors with JavaScriptDateTimeConverter
  • New feature - Added support for strict equals and strict not equals in JSON Path queries

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jun 22, 2022
@lupino3
Copy link
Copy Markdown
Member

lupino3 commented Jul 4, 2022

@dependabot recreate

Bumps [Newtonsoft.json](https://github.com/JamesNK/Newtonsoft.Json) from 9.0.1 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](JamesNK/Newtonsoft.Json@9.0.1...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/nuget/Newtonsoft.json-13.0.1 branch from 1767cdf to fec2d31 Compare July 4, 2022 08:31
@lupino3
Copy link
Copy Markdown
Member

lupino3 commented Jul 4, 2022

Tests failing for Windows PowerShell:

Run tools/run-tests.ps1
  tools/run-tests.ps1
  shell: C:\Windows\System3[2](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:2)\WindowsPowerShell\v1.0\powershell.EXE -command ". '{0}'"
Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.20[3](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:3)[4](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:5)8.643                                                                           
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.20348.643                                                                          
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 
Pester [5](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:6).3.3
Pester 3.4.0
WARNING: You are using Legacy parameter set that adapts Pester 5 syntax to Pester 4 syntax. This parameter set is 
deprecated, and does not work 100%. The -Strict and -PesterOption parameters are ignored, and providing advanced 
configuration to -Path (-Script), and -CodeCoverage via a hash table does not work. Please refer to 
https://github.com/pester/Pester/releases/tag/5.0.1#legacy-parameter-set for more information.
Starting discovery in 1 files.
Discovery found 41 tests in 1.21s.
Starting code coverage.
Running tests.
VERBOSE: Loading module from path 'D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\FeatureFlags.psd1'.
VERBOSE: Loading module from path 'D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\FeatureFlags.psm1'.
Error: [-] FeatureFlags.Tests.ps1 failed with:
Message
  [0] InvalidOperationException: No modules were removed. Verify that the specification of modules to remove is correct and those modules exist in the runspace.
  at <ScriptBlock>, D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\test\FeatureFlags.Tests.ps1:[6](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:7)53
  [1] WriteErrorException: Error loading JSON libraries (D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\External\newtonsoft.json\13.0.1\lib\netstandard1.0\Newtonsoft.Json.dll, D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\External\njsonschema\9.13.19\lib\netstandard1.0\NJsonSchema.dll): Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  at <ScriptBlock>, D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\FeatureFlags.psm1:41
  at <ScriptBlock>, D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\test\FeatureFlags.Tests.ps1:13
Tests completed in 5.28s
Tests Passed: 0, Failed: 41, Skipped: 0 NotRun: 0
Container failed: 1
  - D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\test\FeatureFlags.Tests.ps1
Processing code coverage result.
Covered 12.15% / [7](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:8)5%. 1[8](https://github.com/microsoft/PowerShell-FeatureFlags/runs/7176911274?check_suite_focus=true#step:4:9)1 analyzed Commands in 1 File.
Error: Process completed with exit code 1.

@lupino3
Copy link
Copy Markdown
Member

lupino3 commented Jul 4, 2022

It looks like NJsonSchema is compiled against Newtonsoft.JSON 9.

image

I've tried fiddling with assembly redirects, but the way we import those libraries from PowerShell is very hacky.

I see two alternatives:

  • rewriting the cmdlets in C#, with proper support for assembly redirects etc.
  • trying other JSON / JSON Schema libraries.

For the second, I found https://github.com/gregsdennis/json-everything JsonSchema.Net, which builds on top of System.Net.Json.

I'll try to target netstandard2.0 and use System.Net.Json and JsonSchema.net.

lupino3 and others added 2 commits July 5, 2022 12:22
NJsonSchema depends on Newtonsoft.Json 9.x, which we are upgrading
to 13. Adding an assembly resolver so that the NJsonSchema library
references the updated Newtonsoft.Json assembly.
@lupino3
Copy link
Copy Markdown
Member

lupino3 commented Jul 5, 2022

Turns out, it is possible to use assembly redirects in powershell, I didn't know it.

I set up an assembly redirect (found an example here) and now the tool with updated Newtonsoft.Json works in Windows Powershell as well.

@lupino3 lupino3 merged commit 4154e90 into main Jul 5, 2022
@lupino3 lupino3 deleted the dependabot/nuget/Newtonsoft.json-13.0.1 branch July 5, 2022 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant