public static string BuildJsonExample(ComplexType ct, IEnumerable <Schema> otherSchema) { Dictionary <string, object> dict = BuildDictionaryExample(ct, otherSchema); return(JsonConvert.SerializeObject(dict, Newtonsoft.Json.Formatting.Indented)); }
private static ResourceDefinition ResourceDefinitionFromType(Schema schema, IEnumerable <Schema> otherSchema, ComplexType ct, IssueLogger issues) { var annotation = new CodeBlockAnnotation() { ResourceType = string.Concat(schema.Namespace, ".", ct.Name), BlockType = CodeBlockType.Resource }; var json = BuildJsonExample(ct, otherSchema); ResourceDefinition rd = new JsonResourceDefinition(annotation, json, null, issues); return(rd); }