コード例 #1
0
 private void SerializeArrayProperties(StringBuilder sb, int indentation, ArrayType arrayType)
 {
     RamlSerializerHelper.SerializeProperty(sb, "minItems", arrayType.MinItems, indentation);
     RamlSerializerHelper.SerializeProperty(sb, "maxItems", arrayType.MaxItems, indentation);
     RamlSerializerHelper.SerializeProperty(sb, "uniqueItems", arrayType.UniqueItems, indentation);
     SerializeCommonProperties(sb, arrayType.Items, indentation);
 }
コード例 #2
0
        private static ArrayType GetArray(IDictionary<string, object> dynamicRaml, string key)
        {
            var array = new ArrayType();
            array.MaxItems = DynamicRamlParser.GetIntOrNull(dynamicRaml, "maxItems");
            array.MinItems = DynamicRamlParser.GetIntOrNull(dynamicRaml, "minItems");
            array.UniqueItems = DynamicRamlParser.GetBoolOrNull(dynamicRaml, "maxProperties");

            RamlType items = null;
            if (dynamicRaml.ContainsKey("items"))
            {
                items = GetRamlType(new KeyValuePair<string, object>("", (IDictionary<string, object>)dynamicRaml["items"]));
            }
            array.Items = items;

            return array;
        }
コード例 #3
0
 private void SerializeArray(StringBuilder sb, int indentation, ArrayType arrayType)
 {
     if (arrayType.Items.Array != null)
     {
         SerializeTypeProperty(sb, indentation, arrayType.Items.Array.Items.Type + "[][]");
         SerializeArrayProperties(sb, indentation, arrayType.Items.Array.Items.Array);
     }
     else
     {
         SerializeTypeProperty(sb, indentation, arrayType.Items.Type + "[]");
         SerializeArrayProperties(sb, indentation, arrayType);
     }
 }