Skip to content

Releases: RicoSuter/NJsonSchema

v11.6.0

08 Apr 12:24

Choose a tag to compare

Potentially breaking changes

  • C# 11 required keyword now recognized as required: Properties using the C# 11 required keyword (RequiredMemberAttribute / JsonRequiredAttribute) are now correctly treated as required in schema generation and code output. Previously these were incorrectly treated as optional (Required.Default). This changes generated code: such properties now get Required.Always, [Required] attribute, and the required modifier when UseRequiredKeyword is enabled. (#1908)
  • Both JsonStringEnumMemberName and EnumMember attributes are now emitted for enum members when using System.Text.Json, for compatibility with NSwag's reflection-based URL parameter serialization. (#1905)
  • $schema version preserved in ToJson() instead of forcing draft-04. If you relied on the output always being draft-04, this may affect you. (#1881)
  • patternProperties validation now correctly applies to all matching properties, not just the first. (#1898)
  • MinLength no longer incorrectly applied to DateTime, DateTimeOffset, DateOnly, TimeOnly properties. (#1900)

What's Changed

  • Use NET 10 SDK and upgrade to NUKE 10 by @lahma in #1876
  • Upgrade to NUKE 10.1.0 by @lahma in #1877
  • Fix + in JSON reference paths being decoded as space by @Copilot in #1880
  • Fix property named -1 generating invalid C# identifier instead of Minus1 by @Copilot in #1882
  • Fix infinite loop in RenamePropertyWithSameNameAsClass when suffixed name is already taken by @Copilot in #1883
  • Preserve original $schema version in ToJson() instead of forcing draft-04 by @Copilot in #1881
  • docs: Clarify TypeScriptVersion accepts any decimal ≥ 4.3 by @Copilot in #1884
  • Include root README.md in all NuGet packages by @Copilot in #1885
  • Fix outdated JSON schema output example in README by @Copilot in #1887
  • Add SPDX-License-Identifier to C# file headers by @Copilot in #1886
  • Support JsonPropertyOrder attribute for schema property ordering by @Copilot in #1892
  • Fix generated classes new line for annotations by @Copilot in #1893
  • Support EnumDataType annotation in JSON schema generation by @Copilot in #1890
  • Fix ExtensionData merge behavior and add enum support for JsonSchemaExtensionDataAttribute by @Copilot in #1888
  • SampleJsonDataGenerator: generate GUID for uuid/guid format strings by @Copilot in #1895
  • Fix SampleJsonDataGenerator overflow for long min/max values by @lahma in #1901
  • Fix ObsoleteAttribute not applied to classes with a base class by @lahma in #1902
  • Fix MinLength incorrectly added to DateTime and Date types by @lahma in #1900
  • Fix patternProperties validation to apply to all properties by @lahma in #1898
  • Support C#11 required keyword in schema generation by @lahma in #1908
  • Emit both JsonStringEnumMemberName and EnumMember attributes by @lahma in #1905
  • Fix IsStringEnumArray for nullable enum arrays by @lahma in #1904
  • Fix Display(Name) not setting schema title on classes by @lahma in #1906
  • Fix public fields excluded with STJ IncludeFields=true by @lahma in #1907
  • Fix IPv4 format validator regex false positives by @lahma in #1909
  • Update Namotion.Reflection package to version 3.5.0 by @RicoSuter in #1916

New Contributors

  • @Copilot made their first contribution in #1880

Full Changelog: v11.5.2...v11.6.0

NJsonSchema v11.5.2

05 Nov 10:19

Choose a tag to compare

What's Changed

  • Add JsonLibraryVersion and generate JsonStringEnumMemberNameAttriute for >= 9.0, EnumMemberAttribute otherwise by @RicoSuter in #1865
    • Reverts the breaking change introduced by "Use [JsonStringEnumMemberName] instead of [EnumMember] #1864"
  • Add support for JsonStringEnumConverter<T> detection and test it by @wellWINeo in #1868
  • Update dependencies by @lahma in #1874
  • CSharp generator: Fix required keyword and add write accessor (set/init) by @RicoSuter in #1862

New Contributors

Full Changelog: v11.5.1...v11.5.2

NJsonSchema v11.5.1

30 Sep 19:13
27d3564

Choose a tag to compare

What's Changed

  • fix: Enum descriptions serialization/property by @RicoSuter in #1861
  • Use JsonStringEnumConverter instead of JsonStringEnumConverter by @0xced in #1863
  • Use [JsonStringEnumMemberName] instead of [EnumMember] by @0xced in #1864

New Contributors

Full Changelog: v11.5.0...v11.5.1

NJsonSchema v11.5.0

15 Sep 20:27

Choose a tag to compare

What's Changed

Breaking changes:

  • Change TypeScript default version to 4.3 (removed support for TS versions < 4.3) by @lahma in #1855

Others:

Full Changelog: v11.4.0...v11.5.0

NJsonSchema v11.4.0

30 Jul 20:13
d899346

Choose a tag to compare

What's Changed

  • Cache NJsonSchema properties in JsonReferenceResolver by @lahma in #1817
  • Avoid trying JsonSchema construction for object having boolean required by @lahma in #1818
  • Optimize AsyncJsonReferenceVisitorBase.Visit by @lahma in #1819
  • Allow customizing FluidParser construction by @lahma in #1822
  • Add support for testing whether TS code compiles with tsc by @lahma in #1824
  • Fix ApplyRangeAttribute failing when min/max is specified as string by @sindrekroknes in #1831
  • Add ability to overwrite templates multiple times using templateFolder by @Georgy-Losenkov in #1835
  • Convert to using TS as TYPE instead cast with <TYPE> by @lahma in #1837
  • Convert to using proper Verify tests in TypeScript testing by @lahma in #1838
  • Convert to using proper Verify tests in C# testing by @lahma in #1839
  • Upgrade testing related NuGet packages by @lahma in #1840
  • Upgrade to Fluid 2.25 by @lahma in #1842
  • Use ValueStringBuilder in ConvertDashesToCamelCase by @lahma in #1844
  • C# generator: create anonymous types with camel casing (3rd attempt) by @WolfgangHG in #1828
  • Support configuring whether constructor parameter are sorted by @manfred-brands in #1399
  • Fixed validation of JTokens with type Uri by @ertrumbl in #1403
  • Convert more tests to use verify by @lahma in #1845
  • Replace remaining any cast with as any by @lahma in #1846
  • Convert to xUnit v3 by @lahma in #1848
  • Support description for each x-enumNames value by @lekhmanrus in #1789
  • Remove some unnecessary LINQ usage by @lahma in #1849
  • Optimize camel-casing logic by @lahma in #1850

New Contributors

Full Changelog: v11.3.2...v11.4.0

NJsonSchema v11.3.2

28 Apr 20:46

Choose a tag to compare

What's Changed

  • Revert "C# generator: create anoymous types with camel casing (reworked)" by @RicoSuter in #1816

Full Changelog: v11.3.1...v11.3.2

NJsonSchema v11.3.1

28 Apr 19:50

Choose a tag to compare

What's Changed

  • Don't throw on missing member when resolving template identifier by @lahma in #1815

Full Changelog: v11.3.0...v11.3.1

NJsonSchema v11.3.0

28 Apr 18:47

Choose a tag to compare

What's Changed

  • Add NET 8 targets and fix analyzer reported issues by @lahma in #1792
  • Avoid re-registration of type if member not found in member access by @lahma in #1793
  • Optimize ReflectionServiceBase.IsBinary by @lahma in #1794
  • Optimize JsonSchema.TypeRaw handling by @lahma in #1795
  • Upgrade to Fluid 2.23 by @lahma in #1796
  • Add Verify unified testing support to C# and TypeScript by @lahma in #1800
  • Expand code compilation checks to GeneralGeneratorTests by @lahma in #1801
  • Add support for high precision dates by @philip-reed in #1797
  • Fix RangeAttribute format for decimals by @lahma in #1803
  • Ensure RangeAttribute respects numeric type's min/max by @lahma in #1804
  • Use explicit using for System.Linq to make it easier to spot by @lahma in #1805
  • Replace manual locking and Dictionary with ConcurrentDictionary by @lahma in #1806
  • Remove unnecessary use of Type.GetTypeInfo() by @lahma in #1807
  • Reduce memory allocations by @lahma in #1808
  • Use compiled regex for template's final cleanup by @lahma in #1809
  • Use state with ConcurrentDictionary on modern platforms by @lahma in #1810
  • Upgrade to Fluid 2.24 by @lahma in #1812
  • Fix serialization of arrays with nullable items in TypeScript by @deceptiveSimplicity in #1813
  • C# generator: create anoymous types with camel casing (reworked) by @WolfgangHG in #1788

New Contributors

Full Changelog: v11.2.0...v11.3.0

NJsonSchema v11.2.0

29 Mar 13:16

Choose a tag to compare

What's Changed

  • Prepare for NET 9 SDK analysis by @lahma in #1743
  • Add net8.0 target, drop net6.0 by @lahma in #1744
  • Use collection expressions by @lahma in #1745
  • Remove unnecessary usings by @lahma in #1746
  • Enable implicit usings by @lahma in #1750
  • Use compound assignment and simplify delegate invocation by @lahma in #1749
  • Use pattern matching by @lahma in #1748
  • Simplify collection initialization by @lahma in #1751
  • Use expression bodies for properties and accessors by @lahma in #1752
  • Remove redundant equality checks by @lahma in #1753
  • Upgrade to NUKE 9 by @lahma in #1754
  • Fix analysis warnings in tests by @lahma in #1755
  • Retrieve attributes once in JsonSchemaGenerator.Apply.DataAnnotations by @lahma in #1756
  • Retrieve attributes only once in SystemTextJsonReflectionService.GenerateProperties by @lahma in #1757
  • Upgrade to Fluid.Core version 2.13.1 by @lahma in #1758
  • Make IgnoreEmptyCollectionsContractResolver special case ICollection.Count check by @lahma in #1759
  • Improve JsonSchema.InitializeSchemaCollection performance by @lahma in #1760
  • Update packages by @lahma in #1766
  • Fix TypeMapper UseReference not used when mapping a GenericType by @desjoerd in #1762
  • C# generator: create anoymous types with camel casing by @WolfgangHG in #1716
  • Fix template caching by @Georgy-Losenkov in #1761
  • Upgrade to Fluid 2.19.0 by @lahma in #1770
  • Fix '#' in typescript property names by @TobiasMarklund in #1778
  • Decode percent-encoded characters in $ref URIs - Fix issue #1539 by @viscontem in #1775
  • Add support for UTC date-only format (yyyy-MM-ddZ) by @Eqwerty in #1774
  • Upgrade packages by @lahma in #1780
  • Fix analyzer issues and remove obsolete NoWarn items by @lahma in #1781
  • Upgrade to Fluid 2.21.0 by @lahma in #1785
  • Improve ClassTemplateModel performance by @lahma in #1786
  • SampleJsonSchemaGenerator: Generate JSONSchema for openapi by @javierlarota in #1767
  • Keep Original Enum Names for Reuse in Custom Templates by @lekhmanrus in #1763
  • configurable fieldname by @notlazychen in #1733
  • C# Generator: Generate range for different formats by @rbergheim in #1720
  • feat: option to use c# 11 required keyword for required properties by @alpoi-x in #1711
  • Throw more detailed error messages when encountering Json Schema errors by @hyzx86 in #1707
  • Use generated property name for constructor parameters by @fzzle in #1662

New Contributors

Full Changelog: v11.1.0...v11.2.0

NJsonSchema v11.1.0

19 Nov 13:53
eb2c55e

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v11.0.2...v11.1.0