jsonsystems / public

122 stars 6 forks source link

Unable to identify Dictionary key type from resulting schema #53

Open JustinDDavis opened 1 year ago

JustinDDavis commented 1 year ago

Steps to produce my results:

  1. I am using the https://json-everything.net/json-schema JSON Schema generator, with "Generate a Schema" option selected.
  2. I provide the following example schema and run
    
    class Parent
    {
    public List<ChildDefinition> AllDefinitions {get; set;}
    }

class ChildDefinition { public Dictionary<string, ExtraInformation> Details {get; set;} }

class ExtraInformation { public string Detail1 {get; set;} public string Detail2 {get; set;} }

3. The results look like: 

{ "type": "object", "properties": { "AllDefinitions": { "type": "array", "items": { "type": "object", "properties": { "Details": { "type": "object", "additionalProperties": { "type": "object", "properties": { "Detail1": { "type": "string" }, "Detail2": { "type": "string" } } } } } } } } }



I would expect some way to identify the type of the key used with "Details".  
I went through what documentation I could to see if there is a callout to this type of situation, but I couldn't find anything myself. 

Thank you!