NJsonSchema icon indicating copy to clipboard operation
NJsonSchema copied to clipboard

Possible issue with TypeConverter attribute

Open PacmanForever opened this issue 3 years ago • 1 comments

Hi,

I have a C# class with this attribute:

[TypeConverter(typeof(ExpandableObjectConverter))]

Without the attribute, the JsonSchemaGenerator works fine and generates the json string with all properties, but, when I put this attribute, the result it is:

{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "ClassName", "type": "string" }

Is this an issue or missing something in my code?

Thanks

PacmanForever avatar Jan 03 '22 13:01 PacmanForever

I have the same problem. I'm using TypeConverters all over the place for displaying objects in the Winforms (yikes) PropertyGrid.

I have a similar problem with NewtonsoftJson and I hate it. TypeConverters are a thing of System.ComponentModel and in my opinion should not affect json serialization, at least not by default. But if it does, for whatever reason, I'd like a way to opt out.

wexman avatar Aug 24 '22 10:08 wexman