Пример #1
0
        public static OpenApiRoot Read(JObject docRoot)
        {
            var ret   = new OpenApiRoot();
            var paths = docRoot.SelectToken("paths");

            foreach (var path in paths)
            {
                ret.Paths.Add(OpenApiPath.Read(path));
            }
            return(ret);
        }
Пример #2
0
        public static OpenApiPath Read(JToken path)
        {
            var ret = new OpenApiPath();

            ret.Key = path.ToObject <JProperty>().Name;
            foreach (var operationList in path.ToObject <JProperty>().Children())
            {
                foreach (var operation in operationList.Children())
                {
                    ret.Operations.Add(OpenApiOperation.Read(operation));
                }
            }
            return(ret);
        }