private static Schema GenerateSchemaForProperty(ModelProperty property) { Schema schema = new Schema(); schema.Type = property.Type?.ToCamelCase(); if (schema.Type == null) { schema.Ref = DefintionsRefLocation + property.Ref; } else if (schema.Type.Equals("array")) { schema.Items = new Item(); if (!string.IsNullOrEmpty(property.Items.Type)) { schema.Items.Type = property.Items.Type; } else { schema.Items.Type = "object"; schema.Items.Ref = DefintionsRefLocation + property.Items.Ref; } } return schema; }
public static void ShouldEqual(this ModelProperty actual, ModelProperty expected, string userMessage = null) { (actual as DataType).ShouldEqual(expected, userMessage); actual.Description.ShouldEqual(expected.Description, userMessage.Append("Description")); }