private Schema CreateDictionarySchema(JsonDictionaryContract dictionaryContract) { Type type1 = dictionaryContract.get_DictionaryKeyType(); if ((object)type1 == null) { type1 = typeof(object); } Type enumType = type1; Type type2 = dictionaryContract.get_DictionaryValueType(); if ((object)type2 == null) { type2 = typeof(object); } Type valueType = type2; if (enumType.IsEnum) { return new Schema() { type = "object", properties = (IDictionary <string, Schema>)((IEnumerable <string>)Enum.GetNames(enumType)).ToDictionary <string, string, Schema>((Func <string, string>)(name => dictionaryContract.get_DictionaryKeyResolver()(name)), (Func <string, Schema>)(name => this.CreateInlineSchema(valueType))) } } ; return(new Schema() { type = "object", additionalProperties = this.CreateInlineSchema(valueType) }); }
public static bool IsSelfReferencing(this JsonDictionaryContract dictionaryContract) { return(((JsonContract)dictionaryContract).get_UnderlyingType() == dictionaryContract.get_DictionaryValueType()); }