A Property Object holds the definition of a new property for a model.
Наследование: DataType
Пример #1
0
        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;
        }
Пример #2
0
        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"));
        }