Open moomiji opened 3 hours ago
The .Validate(ValidationContext.ValidContext, ValidationLevel.Verbose)
method also does not work, when only the doc
property is kept.
generate
generatejsonschematypes .\test.json --rootNamespace JsonSchemaSample.Test --outputRootTypeName Test --outputPath .\test
test code
using Corvus.Json;
using JsonSchemaSample.Test;
var test = """ { "a_doc": "aaa", "b_doc": "bbb" } """;
var document = Test.SchemaEntity.Parse(test); var result = document.Validate(ValidationContext.ValidContext, ValidationLevel.Verbose);
- error
Unhandled exception. System.InvalidOperationException: This operation does not apply to an empty instance.
at System.Collections.Immutable.ImmutableStack`1.Pop()
at Corvus.Json.ValidationContext.PopLocation()
at JsonSchemaSample.Test.Test.SchemaEntity.Validate(ValidationContext& validationContext, ValidationLevel level) in C:\Users\73734\source\JsonSchemaSample\test\Test.SchemaEntity.Validate.cs:line 62
at Program.
Error CS0102
Version: 4.0.7 Build: 876fe5b6941ca46f33214412c092b8b2f9699d4e
test.json
Behavior in v3.1.1