Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump NJsonSchema from 9.13.19 to 10.7.2 #35

Closed
wants to merge 3 commits into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 6, 2022

Bumps NJsonSchema from 9.13.19 to 10.7.2.

Release notes

Sourced from NJsonSchema's releases.

NJsonSchema v10.7.2

NJsonSchema v10.7.1

  • Introduced/enhanced validation settings (case insensitive property comparison & custom format validators in settings).

NJsonSchema v10.7.0

  • Various improvements (see merged PRs)

NJsonSchema v10.6.10

No release notes provided.

NJsonSchema v10.6.9

NJsonSchema v10.6.8

  • Fixed C# inheritance code generation for System.Text.Json
  • Other fixes

NJsonSchema v10.6.7

No release notes provided.

NJsonSchema v10.6.6

  • Fix bug in Namotion.Reflection

NJsonSchema v10.6.5

  • AdditionalProperties are only added on the base class (#1451)
  • Fix ConvertCSharpDocs multi-line regression (#1463)

NJsonSchema v10.6.4

  • Fixed toolchain version output in code generators

NJsonSchema v10.6.3

  • More performance improvements
  • Added UseXmlDocumentation and ResolveExternalXmlDocumentation settings in NJsonSchema
    • Breaking change: Use these settings instead of XmlDocsExtensions.ResolveFromNuGetCacheOrDotNetSdk

NJsonSchema v10.6.2

  • Some performance improvements

NJsonSchema v10.6.1

No release notes provided.

NJsonSchema v10.6.0

  • Breaking change: Migrate from DotLiquid to Fluid (reasons: much faster code generation & more strict liquid implementation)
    • You need to migrate custom templates: Replace elseif with elsif, fix newline handling (have a look at the updates templates in the repository).
  • Minor bug fixes

v10.5.2

... (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)

Bumps [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) from 9.13.19 to 10.7.2.
- [Release notes](https://github.com/RicoSuter/NJsonSchema/releases)
- [Commits](https://github.com/RicoSuter/NJsonSchema/commits/v10.7.2)

---
updated-dependencies:
- dependency-name: NJsonSchema
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jul 6, 2022
@lupino3
Copy link
Member

lupino3 commented Jul 6, 2022

Note, this new version of NJsonSchema seems to conflict with the one already loaded in PowerShell: RicoSuter/NJsonSchema#1363. The best course of action may be to rely on Test-Json on recent versions of powershell (which introduces the NJsonSchema dependency) and only use NJsonSchema in older versions.

@lupino3
Copy link
Member

lupino3 commented Jul 8, 2022

This new version doesn't work with Windows PowerShell, at least not out of the box:

  [1] WriteErrorException: Error loading JSON schema: Unable to find type [NJsonSchema.JSonSchema4].. First error: Exception calling "FromJsonAsync" with "1" argument(s): "The type initializer for 'NJsonSchema.JsonSchema' threw an exception.".
  at <ScriptBlock>, D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\FeatureFlags.psm1:92
  at <ScriptBlock>, D:\a\PowerShell-FeatureFlags\PowerShell-FeatureFlags\test\FeatureFlags.Tests.ps1:13
Tests completed in 4.84s
Tests Passed: 0, Failed: 41, Skipped: 0 NotRun: 0

Need to see how the library exposes the schema API under .NET Framework. Seems different from previous versions.

@lupino3
Copy link
Member

lupino3 commented Jul 8, 2022

Ok, updating this seems way more complicated than I expected.
After the update, the JsonSchema::FromAsync method also needs another assembly, Namotion.Reflection.

After providing it, I get a weird casting error from within the library:

C:\Users\andreas\source\github\PowerShell-FeatureFlags\FeatureFlags.psm1 :
System.Management.Automation.MethodInvocationException: Exception calling "FromJsonAsync" with "1" argument(s): "The
type initializer for 'NJsonSchema.JsonSchema' threw an exception." ---> System.TypeInitializationException: The type
initializer for 'NJsonSchema.JsonSchema' threw an exception. ---> System.InvalidCastException: Unable to cast object
of type 'System.Object[]' to type 'System.Collections.Generic.IEnumerable`1[System.Attribute]'.
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at Namotion.Reflection.NullableFlagsSource.GetNullableFlags(Object provider)
   at Namotion.Reflection.NullableFlagsSource.Create(Type type, Assembly assembly)
   at Namotion.Reflection.ContextualPropertyInfo..ctor(PropertyInfo propertyInfo, Int32& nullableFlagsIndex, Byte[]
nullableFlags)
   at Namotion.Reflection.ContextualType.<get_Properties>b__43_0(PropertyInfo property)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Namotion.Reflection.ContextualType.get_Properties()
   at NJsonSchema.JsonSchema..cctor()
   --- End of inner exception stack trace ---
   at NJsonSchema.JsonSchema.FromJsonAsync(String data, String documentPath, CancellationToken cancellationToken)
   at CallSite.Target(Closure , CallSite , Type , Object )
   --- End of inner exception stack trace ---
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception
exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
At C:\Users\andreas\source\github\PowerShell-FeatureFlags\tools\run-tests.ps1:12 char:11
+ $Module = Import-Module $PSScriptRoot\..\${ModuleName}.psd1 -Force -P ...
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,FeatureFlags.psm1

I tried explicitly adding the Linq assembly, as this looks like a cast that should happen implicitly, but it still doesn't work.

However, if I change the target framework to netstandard2.0 the library works.

I don't want to introduce such a breaking change, so for now I'll leave the library as it is.

@lupino3
Copy link
Member

lupino3 commented Jul 8, 2022

@dependabot ignore this minor version

@lupino3 lupino3 closed this Jul 8, 2022
@dependabot dependabot bot deleted the dependabot/nuget/NJsonSchema-10.7.2 branch July 8, 2022 13:22
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 8, 2022

OK, I won't notify you about version 10.7.x again, unless you re-open this PR or update to a 10.7.x release yourself.

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