Skip to content

Commit

Permalink
support jsonnode; update version and release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
gregsdennis committed Aug 30, 2023
1 parent e1b02d5 commit f409d65
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions JsonSchema.Generation/GeneratorRegistry.cs
Expand Up @@ -22,6 +22,7 @@ public static class GeneratorRegistry
new DateTimeSchemaGenerator(),
new GuidSchemaGenerator(),
new JsonPointerSchemaGenerator(),
new JsonNodeSchemaGenerator(),
new JsonArraySchemaGenerator(),
new JsonObjectSchemaGenerator(),
new JsonValueSchemaGenerator(),
Expand Down
17 changes: 17 additions & 0 deletions JsonSchema.Generation/Generators/JsonNodeSchemaGenerator.cs
@@ -0,0 +1,17 @@
using System;
using System.Text.Json.Nodes;

namespace Json.Schema.Generation.Generators;

internal class JsonNodeSchemaGenerator : ISchemaGenerator
{
public bool Handles(Type type)
{
return type == typeof(JsonNode);
}

public void AddConstraints(SchemaGenerationContextBase context)
{
// don't add anything. really, we want a true schema here.
}
}
4 changes: 2 additions & 2 deletions JsonSchema.Generation/JsonSchema.Generation.csproj
Expand Up @@ -19,8 +19,8 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<DocumentationFile>JsonSchema.Net.Generation.xml</DocumentationFile>
<LangVersion>latest</LangVersion>
<Version>3.3.1</Version>
<FileVersion>3.3.1.0</FileVersion>
<Version>3.3.2</Version>
<FileVersion>3.3.2.0</FileVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down
Expand Up @@ -4,6 +4,10 @@ title: JsonSchema.Net.Generation
icon: fas fa-tag
order: "8.02"
---
# [3.3.2](https://github.com/gregsdennis/json-everything/pull/513) {#release-schemagen-3.3.2}

[#512](https://github.com/gregsdennis/json-everything/issues/512) - There was no support for `JsonNode`, explicitly. Instead it would attempt to generate via reflection. This update adds that support and just generates a `true` schema. Thanks to [@ashek-simeon](https://github.com/ashek-simeon) for reporting and recommending a solution.

# [3.3.1](https://github.com/gregsdennis/json-everything/pull/491) {#release-schemagen-3.3.1}

[#488](https://github.com/gregsdennis/json-everything/issues/488) - `[Maximum(double.MaxValue)]` throws an overflow exception when attempting to convert to decimal. This fix updates all min/max-related attributes.
Expand Down

0 comments on commit f409d65

Please sign in to comment.