Exemple #1
0
        private static Parameter ParsePathParameter(JToken parameter)
        {
            var type = parameter["type"].Value <string>();
            var item = default(OtherParameter);

            switch (type.ToUpper())
            {
            case "ARRAY":
            {
                item = new OtherArrayParameter();
                ParseOtherArrayParameter(item as OtherArrayParameter, parameter);
                break;
            }

            default:
            {
                item = new OtherParameter();
                break;
            }
            }

            item.Name     = parameter["name"].Value <string>();
            item.In       = parameter["in"].Value <string>();
            item.Type     = type;
            item.Required = parameter["required"]?.Value <bool>() ?? true;
            ParseCommonOtherParameter(item, parameter);
            return(item);
        }
Exemple #2
0
 private static void ParseOtherArrayParameter(OtherArrayParameter item, JToken parameter)
 {
     item.Items = new[] { ParseItems(parameter["items"]) };
 }