C#C
C#3y ago
SWEETPONY

❔ How to create json schema by class?

I have following class:
internal class ReportGenerateParameters
{
    [JsonProperty(PropertyName = "departments_ids")]
    public HashSet<string> DepartmentIDs { get; set; }

    [JsonProperty(PropertyName = "page_break_after_department")]
    public bool PageBreakAfterDepartment { get; set; } = true;

    [JsonProperty(PropertyName ="show_subjects_of_nested_departments")]
    public bool ShowSubjectsOfNestedDepartments { get; set; }
}

And I can create manually json schema using this class, it will look in following way:
https://gist.github.com/INTERNALINTERFERENCE/ca09a767eb4027c593416ae8ff155274

I'd like to automate generating of this json. How can I do it? Can someone give some information about this?
Gist
GitHub Gist: instantly share code, notes, and snippets.
Was this page helpful?