Anil

Anil

  • NA
  • 12
  • 2.8k

Generating C# Classes From JSON Schema

Jan 5 2023 2:28 PM

Hello, I searched for lots of tools to create C# class from JSON schema but none of them seems to work properly. Since I have a couple of large JSON schemas I need to automate this. But ordinary converters like json2csharp or libraries like NJsonSchema are not working (or I couldn't find how to) for a schema like this:

{
    "person": {
        "type": "object",
        "properties": {
            "name": {
                "$ref": "#/definitions/name",
                "title": "",
                "description": ""
            }
        }
    }
}

They all see properties as class and for example title as field. So generated classes are not proper. Do you have any suggestions?


Answers (5)