Skip to content

Conversation

statler
Copy link
Owner

@statler statler commented Dec 16, 2019

No description provided.

RicoSuter and others added 30 commits February 16, 2022 11:06
….Json (#1492)

* fix: system.text.json enum naming policy

* Update SystemTextJsonUtilities.cs

Co-authored-by: Rico Suter <[email protected]>
* Add support for TypeScript 4.3 override keyword

* Create verify tests for different output styles and TS versions
* Update CSharpPropertyNameGenerator.cs

Added ampersand sign (&) replacement in name generator.

* Update CSharpPropertyNameGenerator.cs

Co-authored-by: Rico Suter <[email protected]>
* Generate STJ JsonIgnoreAttributes for model properties

* Update PropertyModel.cs

Co-authored-by: Rico Suter <[email protected]>
* Update JsonInheritanceConverter.liquid

The InheritanceConverters needs to be made public so downstream NSwag Generator can get the DiscriminatorName (i.e. wrapping Client classes in another generated client class)

Error below:
6> ---> Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Text.Json.Serialization.JsonConverter<BaseClass>' does not contain a definition for 'DiscriminatorName'

* updated missing namepace for JsonException

* fix unit tests

Co-authored-by: Mike Mao <[email protected]>
* #250 Allow case insensitive property validation

* Handle ignore casing on required properties not in schema

* Rename 'JsonSchemaValidatorSettings' to 'JsonSchemaValidatorOptions'

* Allow using custom StringComparer for property validation
…lity issues. (#1520)

* Re-add old JsonSchemaValidator constructor to fix backwards compatability issues.

* Update JsonSchemaValidator.cs

Co-authored-by: Rico Suter <[email protected]>
This allows to implement different logic e.g. treat JsonSchema.OneOf
to have multiple (non nullable) items instead of zero or one.
* Fix output of JsonIgnore attributes

* Recognize Guid as value type

* Rename variable

* Use JsonFormatStrings for ValueTypeFormats

* Easier fix

* Remove unused field
* Convert DateOnly properties to local timezone for TypeScriptDateTimeType.Date

* adjust parseDateOnly

* fix ArrayItemDate

* fix DateOnly code
* Add support for flag enums with more than 32 values

* Update EnumTests.cs

Co-authored-by: Christoph Genneper <[email protected]>
Co-authored-by: Rico Suter <[email protected]>
sindrekroknes and others added 30 commits June 15, 2025 08:46
* Allow disabling sorting of constructor parameters
* Base class parameters should come before derived class parameters

---------

Co-authored-by: Marko Lahma <[email protected]>
* make regexes lazy
* cleanup
- Add test cases for enum descriptions and backward compatibility
- Add test case for enum descriptions with Description attributes
- Add backward compatibility tests for x-enum-names, x-enum-varnames, and x-enum-descriptions

---------

Co-authored-by: Marko Lahma <[email protected]>
* use compiled regex in CSharpDocs, check if replacement needed
* proper constant stack allocation size in ConversionUtilities
* better replace behavior in JsonReferenceVisitorBase
* Improve enum description handling and  make reading tolerant to invalid data
* don't output multiple versions, just support reading multiple
)

Unlike JsonStringEnumConverter, the generic JsonStringEnumConverter<T> is AOT compatible.

This prevents the [SYSLIB1034](https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib1034) warning to occur when System.Text.Json source generation is used.
System.Text.Json ignores the `System.Runtime.Serialization.EnumMember` attribute. It needs the [`System.Text.Json.Serialization.JsonStringEnumMemberName` attribute](https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/customize-properties#custom-enum-member-names) to customize the names of individual enum members.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.