Exemple #1
0
 public static SwaggerModel Parse(string json)
 {
     using (JsonReader reader = new JsonTextReader(new StringReader(json)))
     {
         var builder = new SwaggerJsonBuilder();
         var swagger = builder.Read(reader);
         var token   = JToken.FromObject(swagger, _serializer.Value);
         return(token.ToObject <SwaggerModel>(_serializer.Value));
     }
 }
        public static SwaggerModel Parse(string swaggerFilePath)
        {
            // Deserialize to internal swagger model
            var builder = new SwaggerJsonBuilder();
            var swagger = builder.Read(swaggerFilePath);

            // Serialize to JToken
            var token = JToken.FromObject(swagger, Serializer.Value);

            // Convert to swagger model
            return(token.ToObject <SwaggerModel>(Serializer.Value));
        }
Exemple #3
0
        public static SwaggerModel Parse(string json)
        {
            using (JsonReader reader = new JsonTextReader(new StringReader(json)))
            {
                // Deserialize to internal swagger model
                var builder = new SwaggerJsonBuilder();
                var swagger = builder.Read(reader);

                // Serialze to JToken
                var token = JToken.FromObject(swagger, _serializer.Value);

                // Convert to swagger model
                return(token.ToObject <SwaggerModel>(_serializer.Value));
            }
        }