asp.net mvc5中使用Swagger 自动生成WebApi文档笔记
Swagger可以自动生成Api说明文档,并内置在线测试,通过NSwagStudio还可以自动生成Api客户端调用代码,以下为具体实现步骤
1、写一个简单的WebApi并加上注释
public class ValuesController : ApiController
{ /// <summary>
/// 这是一个Post测试
/// </summary>
/// <param name="para"></param>
/// <returns></returns>
[HttpPost]
public JsonResult<object> GetJsonValue([FromBody]InputValue para)
{
using (IDbConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString))
{
cn.Open();
var ret = SqlMapper.Query(cn, "select * from AbpRoles where Id = @id", new { Id = para.Id });
return Json<object>(ret);
}
} /// <summary>
/// 传入参数
/// </summary>
public class InputValue
{
/// <summary>
/// 主键
/// </summary>
public int Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}
2、首先要配置项目可以生成XML说明文档,右击你的项目->生成->输出->勾上 XML文档文件 然后把这个文件名放在下面的代码里.
3、然后 在Areas/HelpPage/App_Start/HelpPageConfig.cs 文件中目前应该是第62行. 增加下面的代码
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/bin/MvcWebApi01.xml")));
4、安装Swagger
Install-Package Swashbuckle -Version 5.6.
5、添加导航链接
string path = string.Format("{0}/bin/MvcWebApi01.xml", System.AppDomain.CurrentDomain.BaseDirectory);
c.IncludeXmlComments(path);
7、在线测试WebApi,文档注释会自动显示
8、下载NSwagStudio,https://github.com/RSuter/NSwag
9、输入swagger地址,http://localhost/MvcWebApi01/swagger/docs/v1,点击生成即可自动生成ts、c# client 、c# web api controler三种类型的调用客户端
下面为生成的代码地址
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v11.17.21.0 (NJsonSchema v9.10.63.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org)
// </auto-generated>
//---------------------- namespace MyNamespace
{
#pragma warning disable // Disable all warnings [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.17.21.0 (NJsonSchema v9.10.63.0 (Newtonsoft.Json v9.0.0.0))")]
public partial class ValuesClient
{
private string _baseUrl = "http://localhost/MvcWebApi01";
private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings; public ValuesClient(string baseUrl)
{
_baseUrl = baseUrl;
_settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(() =>
{
var settings = new Newtonsoft.Json.JsonSerializerSettings();
UpdateJsonSerializerSettings(settings);
return settings;
});
} public string BaseUrl
{
get { return _baseUrl; }
set { _baseUrl = value; }
} protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); /// <returns>OK</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
public System.Threading.Tasks.Task<System.Collections.ObjectModel.ObservableCollection<string>> GetAllAsync()
{
return GetAllAsync(System.Threading.CancellationToken.None);
} /// <returns>OK</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
public async System.Threading.Tasks.Task<System.Collections.ObjectModel.ObservableCollection<string>> GetAllAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Values/Get"); var client_ = new System.Net.Http.HttpClient();
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
} ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString();
if (status_ == "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = default(System.Collections.ObjectModel.ObservableCollection<string>);
try
{
result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<System.Collections.ObjectModel.ObservableCollection<string>>(responseData_, _settings.Value);
return result_;
}
catch (System.Exception exception_)
{
throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
}
}
else
if (status_ != "" && status_ != "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
} return default(System.Collections.ObjectModel.ObservableCollection<string>);
}
finally
{
if (response_ != null)
response_.Dispose();
}
}
}
finally
{
if (client_ != null)
client_.Dispose();
}
} /// <returns>OK</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
public System.Threading.Tasks.Task<string> GetAsync(int id)
{
return GetAsync(id, System.Threading.CancellationToken.None);
} /// <returns>OK</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
public async System.Threading.Tasks.Task<string> GetAsync(int id, System.Threading.CancellationToken cancellationToken)
{
if (id == null)
throw new System.ArgumentNullException("id"); var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Values/Get/{id}");
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); var client_ = new System.Net.Http.HttpClient();
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
} ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString();
if (status_ == "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = default(string);
try
{
result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(responseData_, _settings.Value);
return result_;
}
catch (System.Exception exception_)
{
throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
}
}
else
if (status_ != "" && status_ != "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
} return default(string);
}
finally
{
if (response_ != null)
response_.Dispose();
}
}
}
finally
{
if (client_ != null)
client_.Dispose();
}
} /// <returns>No Content</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
public System.Threading.Tasks.Task PostAsync(string value)
{
return PostAsync(value, System.Threading.CancellationToken.None);
} /// <returns>No Content</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
public async System.Threading.Tasks.Task PostAsync(string value, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Values/Post"); var client_ = new System.Net.Http.HttpClient();
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(value, _settings.Value));
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST"); PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
} ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString();
if (status_ == "")
{
return;
}
else
if (status_ != "" && status_ != "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
finally
{
if (response_ != null)
response_.Dispose();
}
}
}
finally
{
if (client_ != null)
client_.Dispose();
}
} /// <returns>No Content</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
public System.Threading.Tasks.Task PutAsync(int id, string value)
{
return PutAsync(id, value, System.Threading.CancellationToken.None);
} /// <returns>No Content</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
public async System.Threading.Tasks.Task PutAsync(int id, string value, System.Threading.CancellationToken cancellationToken)
{
if (id == null)
throw new System.ArgumentNullException("id"); var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Values/Put/{id}");
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); var client_ = new System.Net.Http.HttpClient();
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(value, _settings.Value));
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("PUT"); PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
} ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString();
if (status_ == "")
{
return;
}
else
if (status_ != "" && status_ != "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
finally
{
if (response_ != null)
response_.Dispose();
}
}
}
finally
{
if (client_ != null)
client_.Dispose();
}
} /// <returns>No Content</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
public System.Threading.Tasks.Task DeleteAsync(int id)
{
return DeleteAsync(id, System.Threading.CancellationToken.None);
} /// <returns>No Content</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
public async System.Threading.Tasks.Task DeleteAsync(int id, System.Threading.CancellationToken cancellationToken)
{
if (id == null)
throw new System.ArgumentNullException("id"); var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Values/Delete/{id}");
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); var client_ = new System.Net.Http.HttpClient();
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("DELETE"); PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
} ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString();
if (status_ == "")
{
return;
}
else
if (status_ != "" && status_ != "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
}
}
finally
{
if (response_ != null)
response_.Dispose();
}
}
}
finally
{
if (client_ != null)
client_.Dispose();
}
} /// <summary>这是一个Post测试</summary>
/// <returns>OK</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
public System.Threading.Tasks.Task<object> GetJsonValueAsync(InputValue para)
{
return GetJsonValueAsync(para, System.Threading.CancellationToken.None);
} /// <summary>这是一个Post测试</summary>
/// <returns>OK</returns>
/// <exception cref="SwaggerException">A server side error occurred.</exception>
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
public async System.Threading.Tasks.Task<object> GetJsonValueAsync(InputValue para, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Values/GetJsonValue"); var client_ = new System.Net.Http.HttpClient();
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(para, _settings.Value));
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_); var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
} ProcessResponse(client_, response_); var status_ = ((int)response_.StatusCode).ToString();
if (status_ == "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
var result_ = default(object);
try
{
result_ = Newtonsoft.Json.JsonConvert.DeserializeObject<object>(responseData_, _settings.Value);
return result_;
}
catch (System.Exception exception_)
{
throw new SwaggerException("Could not deserialize the response body.", (int)response_.StatusCode, responseData_, headers_, exception_);
}
}
else
if (status_ != "" && status_ != "")
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null);
} return default(object);
}
finally
{
if (response_ != null)
response_.Dispose();
}
}
}
finally
{
if (client_ != null)
client_.Dispose();
}
} private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
{
if (value is System.Enum)
{
string name = System.Enum.GetName(value.GetType(), value);
if (name != null)
{
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
if (field != null)
{
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
as System.Runtime.Serialization.EnumMemberAttribute;
if (attribute != null)
{
return attribute.Value;
}
}
}
}
else if (value is byte[])
{
return System.Convert.ToBase64String((byte[])value);
}
else if (value != null && value.GetType().IsArray)
{
var array = System.Linq.Enumerable.OfType<object>((System.Array)value);
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
} return System.Convert.ToString(value, cultureInfo);
}
} /// <summary>传入参数</summary>
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class InputValue : System.ComponentModel.INotifyPropertyChanged
{
private int? _id;
private string _name; /// <summary>主键</summary>
[Newtonsoft.Json.JsonProperty("Id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Id
{
get { return _id; }
set
{
if (_id != value)
{
_id = value;
RaisePropertyChanged();
}
}
} /// <summary>名称</summary>
[Newtonsoft.Json.JsonProperty("Name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Name
{
get { return _name; }
set
{
if (_name != value)
{
_name = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static InputValue FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<InputValue>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class JsonResultOfObject : System.ComponentModel.INotifyPropertyChanged
{
private object _content;
private JsonSerializerSettings _serializerSettings;
private Encoding _encoding;
private object _request; [Newtonsoft.Json.JsonProperty("Content", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object Content
{
get { return _content; }
set
{
if (_content != value)
{
_content = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("SerializerSettings", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettings SerializerSettings
{
get { return _serializerSettings; }
set
{
if (_serializerSettings != value)
{
_serializerSettings = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Encoding", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Encoding Encoding
{
get { return _encoding; }
set
{
if (_encoding != value)
{
_encoding = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Request", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object Request
{
get { return _request; }
set
{
if (_request != value)
{
_request = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static JsonResultOfObject FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<JsonResultOfObject>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class JsonSerializerSettings : System.ComponentModel.INotifyPropertyChanged
{
private JsonSerializerSettingsReferenceLoopHandling? _referenceLoopHandling;
private JsonSerializerSettingsMissingMemberHandling? _missingMemberHandling;
private JsonSerializerSettingsObjectCreationHandling? _objectCreationHandling;
private JsonSerializerSettingsNullValueHandling? _nullValueHandling;
private JsonSerializerSettingsDefaultValueHandling? _defaultValueHandling;
private System.Collections.ObjectModel.ObservableCollection<JsonConverter> _converters;
private JsonSerializerSettingsPreserveReferencesHandling? _preserveReferencesHandling;
private JsonSerializerSettingsTypeNameHandling? _typeNameHandling;
private JsonSerializerSettingsMetadataPropertyHandling? _metadataPropertyHandling;
private JsonSerializerSettingsTypeNameAssemblyFormat? _typeNameAssemblyFormat;
private JsonSerializerSettingsTypeNameAssemblyFormatHandling? _typeNameAssemblyFormatHandling;
private JsonSerializerSettingsConstructorHandling? _constructorHandling;
private object _contractResolver;
private object _equalityComparer;
private object _referenceResolver;
private FuncOfIReferenceResolver _referenceResolverProvider;
private ITraceWriter _traceWriter;
private object _binder;
private object _serializationBinder;
private object _error;
private StreamingContext _context;
private string _dateFormatString;
private int? _maxDepth;
private JsonSerializerSettingsFormatting? _formatting;
private JsonSerializerSettingsDateFormatHandling? _dateFormatHandling;
private JsonSerializerSettingsDateTimeZoneHandling? _dateTimeZoneHandling;
private JsonSerializerSettingsDateParseHandling? _dateParseHandling;
private JsonSerializerSettingsFloatFormatHandling? _floatFormatHandling;
private JsonSerializerSettingsFloatParseHandling? _floatParseHandling;
private JsonSerializerSettingsStringEscapeHandling? _stringEscapeHandling;
private string _culture;
private bool? _checkAdditionalContent; [Newtonsoft.Json.JsonProperty("ReferenceLoopHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsReferenceLoopHandling? ReferenceLoopHandling
{
get { return _referenceLoopHandling; }
set
{
if (_referenceLoopHandling != value)
{
_referenceLoopHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("MissingMemberHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsMissingMemberHandling? MissingMemberHandling
{
get { return _missingMemberHandling; }
set
{
if (_missingMemberHandling != value)
{
_missingMemberHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("ObjectCreationHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsObjectCreationHandling? ObjectCreationHandling
{
get { return _objectCreationHandling; }
set
{
if (_objectCreationHandling != value)
{
_objectCreationHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("NullValueHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsNullValueHandling? NullValueHandling
{
get { return _nullValueHandling; }
set
{
if (_nullValueHandling != value)
{
_nullValueHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("DefaultValueHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsDefaultValueHandling? DefaultValueHandling
{
get { return _defaultValueHandling; }
set
{
if (_defaultValueHandling != value)
{
_defaultValueHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Converters", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.ObjectModel.ObservableCollection<JsonConverter> Converters
{
get { return _converters; }
set
{
if (_converters != value)
{
_converters = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("PreserveReferencesHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsPreserveReferencesHandling? PreserveReferencesHandling
{
get { return _preserveReferencesHandling; }
set
{
if (_preserveReferencesHandling != value)
{
_preserveReferencesHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("TypeNameHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsTypeNameHandling? TypeNameHandling
{
get { return _typeNameHandling; }
set
{
if (_typeNameHandling != value)
{
_typeNameHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("MetadataPropertyHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsMetadataPropertyHandling? MetadataPropertyHandling
{
get { return _metadataPropertyHandling; }
set
{
if (_metadataPropertyHandling != value)
{
_metadataPropertyHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("TypeNameAssemblyFormat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsTypeNameAssemblyFormat? TypeNameAssemblyFormat
{
get { return _typeNameAssemblyFormat; }
set
{
if (_typeNameAssemblyFormat != value)
{
_typeNameAssemblyFormat = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("TypeNameAssemblyFormatHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsTypeNameAssemblyFormatHandling? TypeNameAssemblyFormatHandling
{
get { return _typeNameAssemblyFormatHandling; }
set
{
if (_typeNameAssemblyFormatHandling != value)
{
_typeNameAssemblyFormatHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("ConstructorHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsConstructorHandling? ConstructorHandling
{
get { return _constructorHandling; }
set
{
if (_constructorHandling != value)
{
_constructorHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("ContractResolver", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object ContractResolver
{
get { return _contractResolver; }
set
{
if (_contractResolver != value)
{
_contractResolver = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("EqualityComparer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object EqualityComparer
{
get { return _equalityComparer; }
set
{
if (_equalityComparer != value)
{
_equalityComparer = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("ReferenceResolver", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object ReferenceResolver
{
get { return _referenceResolver; }
set
{
if (_referenceResolver != value)
{
_referenceResolver = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("ReferenceResolverProvider", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public FuncOfIReferenceResolver ReferenceResolverProvider
{
get { return _referenceResolverProvider; }
set
{
if (_referenceResolverProvider != value)
{
_referenceResolverProvider = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("TraceWriter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public ITraceWriter TraceWriter
{
get { return _traceWriter; }
set
{
if (_traceWriter != value)
{
_traceWriter = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Binder", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object Binder
{
get { return _binder; }
set
{
if (_binder != value)
{
_binder = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("SerializationBinder", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object SerializationBinder
{
get { return _serializationBinder; }
set
{
if (_serializationBinder != value)
{
_serializationBinder = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Error", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object Error
{
get { return _error; }
set
{
if (_error != value)
{
_error = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Context", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public StreamingContext Context
{
get { return _context; }
set
{
if (_context != value)
{
_context = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("DateFormatString", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string DateFormatString
{
get { return _dateFormatString; }
set
{
if (_dateFormatString != value)
{
_dateFormatString = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("MaxDepth", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? MaxDepth
{
get { return _maxDepth; }
set
{
if (_maxDepth != value)
{
_maxDepth = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Formatting", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsFormatting? Formatting
{
get { return _formatting; }
set
{
if (_formatting != value)
{
_formatting = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("DateFormatHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsDateFormatHandling? DateFormatHandling
{
get { return _dateFormatHandling; }
set
{
if (_dateFormatHandling != value)
{
_dateFormatHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("DateTimeZoneHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsDateTimeZoneHandling? DateTimeZoneHandling
{
get { return _dateTimeZoneHandling; }
set
{
if (_dateTimeZoneHandling != value)
{
_dateTimeZoneHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("DateParseHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsDateParseHandling? DateParseHandling
{
get { return _dateParseHandling; }
set
{
if (_dateParseHandling != value)
{
_dateParseHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("FloatFormatHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsFloatFormatHandling? FloatFormatHandling
{
get { return _floatFormatHandling; }
set
{
if (_floatFormatHandling != value)
{
_floatFormatHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("FloatParseHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsFloatParseHandling? FloatParseHandling
{
get { return _floatParseHandling; }
set
{
if (_floatParseHandling != value)
{
_floatParseHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("StringEscapeHandling", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public JsonSerializerSettingsStringEscapeHandling? StringEscapeHandling
{
get { return _stringEscapeHandling; }
set
{
if (_stringEscapeHandling != value)
{
_stringEscapeHandling = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Culture", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Culture
{
get { return _culture; }
set
{
if (_culture != value)
{
_culture = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("CheckAdditionalContent", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? CheckAdditionalContent
{
get { return _checkAdditionalContent; }
set
{
if (_checkAdditionalContent != value)
{
_checkAdditionalContent = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static JsonSerializerSettings FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<JsonSerializerSettings>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class Encoding : System.ComponentModel.INotifyPropertyChanged
{
private int? _m_codePage;
private CodePageDataItem _dataItem;
private bool? _m_isReadOnly;
private EncoderFallback _encoderFallback;
private DecoderFallback _decoderFallback; [Newtonsoft.Json.JsonProperty("m_codePage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? M_codePage
{
get { return _m_codePage; }
set
{
if (_m_codePage != value)
{
_m_codePage = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("dataItem", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public CodePageDataItem DataItem
{
get { return _dataItem; }
set
{
if (_dataItem != value)
{
_dataItem = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_isReadOnly", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? M_isReadOnly
{
get { return _m_isReadOnly; }
set
{
if (_m_isReadOnly != value)
{
_m_isReadOnly = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("encoderFallback", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public EncoderFallback EncoderFallback
{
get { return _encoderFallback; }
set
{
if (_encoderFallback != value)
{
_encoderFallback = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("decoderFallback", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public DecoderFallback DecoderFallback
{
get { return _decoderFallback; }
set
{
if (_decoderFallback != value)
{
_decoderFallback = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static Encoding FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<Encoding>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class JsonConverter : System.ComponentModel.INotifyPropertyChanged
{
private bool? _canRead;
private bool? _canWrite; [Newtonsoft.Json.JsonProperty("CanRead", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? CanRead
{
get { return _canRead; }
set
{
if (_canRead != value)
{
_canRead = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("CanWrite", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? CanWrite
{
get { return _canWrite; }
set
{
if (_canWrite != value)
{
_canWrite = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static JsonConverter FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<JsonConverter>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class FuncOfIReferenceResolver : System.ComponentModel.INotifyPropertyChanged
{
private object _method;
private object _target; [Newtonsoft.Json.JsonProperty("Method", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object Method
{
get { return _method; }
set
{
if (_method != value)
{
_method = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("Target", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object Target
{
get { return _target; }
set
{
if (_target != value)
{
_target = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static FuncOfIReferenceResolver FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<FuncOfIReferenceResolver>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class ITraceWriter : System.ComponentModel.INotifyPropertyChanged
{
private ITraceWriterLevelFilter? _levelFilter; [Newtonsoft.Json.JsonProperty("LevelFilter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public ITraceWriterLevelFilter? LevelFilter
{
get { return _levelFilter; }
set
{
if (_levelFilter != value)
{
_levelFilter = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static ITraceWriter FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<ITraceWriter>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class StreamingContext : System.ComponentModel.INotifyPropertyChanged
{
private object _m_additionalContext;
private StreamingContextM_state? _m_state; [Newtonsoft.Json.JsonProperty("m_additionalContext", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public object M_additionalContext
{
get { return _m_additionalContext; }
set
{
if (_m_additionalContext != value)
{
_m_additionalContext = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_state", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public StreamingContextM_state? M_state
{
get { return _m_state; }
set
{
if (_m_state != value)
{
_m_state = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static StreamingContext FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<StreamingContext>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class CodePageDataItem : System.ComponentModel.INotifyPropertyChanged
{
private int? _m_dataIndex;
private int? _m_uiFamilyCodePage;
private string _m_webName;
private string _m_headerName;
private string _m_bodyName;
private int? _m_flags; [Newtonsoft.Json.JsonProperty("m_dataIndex", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? M_dataIndex
{
get { return _m_dataIndex; }
set
{
if (_m_dataIndex != value)
{
_m_dataIndex = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_uiFamilyCodePage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? M_uiFamilyCodePage
{
get { return _m_uiFamilyCodePage; }
set
{
if (_m_uiFamilyCodePage != value)
{
_m_uiFamilyCodePage = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_webName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string M_webName
{
get { return _m_webName; }
set
{
if (_m_webName != value)
{
_m_webName = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_headerName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string M_headerName
{
get { return _m_headerName; }
set
{
if (_m_headerName != value)
{
_m_headerName = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_bodyName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string M_bodyName
{
get { return _m_bodyName; }
set
{
if (_m_bodyName != value)
{
_m_bodyName = value;
RaisePropertyChanged();
}
}
} [Newtonsoft.Json.JsonProperty("m_flags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? M_flags
{
get { return _m_flags; }
set
{
if (_m_flags != value)
{
_m_flags = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static CodePageDataItem FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<CodePageDataItem>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class EncoderFallback : System.ComponentModel.INotifyPropertyChanged
{
private bool? _bIsMicrosoftBestFitFallback; [Newtonsoft.Json.JsonProperty("bIsMicrosoftBestFitFallback", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? BIsMicrosoftBestFitFallback
{
get { return _bIsMicrosoftBestFitFallback; }
set
{
if (_bIsMicrosoftBestFitFallback != value)
{
_bIsMicrosoftBestFitFallback = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static EncoderFallback FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<EncoderFallback>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public partial class DecoderFallback : System.ComponentModel.INotifyPropertyChanged
{
private bool? _bIsMicrosoftBestFitFallback; [Newtonsoft.Json.JsonProperty("bIsMicrosoftBestFitFallback", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public bool? BIsMicrosoftBestFitFallback
{
get { return _bIsMicrosoftBestFitFallback; }
set
{
if (_bIsMicrosoftBestFitFallback != value)
{
_bIsMicrosoftBestFitFallback = value;
RaisePropertyChanged();
}
}
} public string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
} public static DecoderFallback FromJson(string data)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<DecoderFallback>(data);
} public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
} } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsReferenceLoopHandling
{
_0 = , _1 = , _2 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsMissingMemberHandling
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsObjectCreationHandling
{
_0 = , _1 = , _2 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsNullValueHandling
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsDefaultValueHandling
{
_0 = , _1 = , _2 = , _3 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsPreserveReferencesHandling
{
_0 = , _1 = , _2 = , _3 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsTypeNameHandling
{
_0 = , _1 = , _2 = , _3 = , _4 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsMetadataPropertyHandling
{
_0 = , _1 = , _2 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsTypeNameAssemblyFormat
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsTypeNameAssemblyFormatHandling
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsConstructorHandling
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsFormatting
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsDateFormatHandling
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsDateTimeZoneHandling
{
_0 = , _1 = , _2 = , _3 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsDateParseHandling
{
_0 = , _1 = , _2 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsFloatFormatHandling
{
_0 = , _1 = , _2 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsFloatParseHandling
{
_0 = , _1 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum JsonSerializerSettingsStringEscapeHandling
{
_0 = , _1 = , _2 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum ITraceWriterLevelFilter
{
_0 = , _1 = , _2 = , _3 = , _4 = , } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.63.0 (Newtonsoft.Json v9.0.0.0)")]
public enum StreamingContextM_state
{
_1 = , _2 = , _4 = , _8 = , _16 = , _32 = , _64 = , _128 = , _255 = , } [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.17.21.0 (NJsonSchema v9.10.63.0 (Newtonsoft.Json v9.0.0.0))")]
public partial class SwaggerException : System.Exception
{
public int StatusCode { get; private set; } public string Response { get; private set; } public System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; } public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException)
: base(message, innerException)
{
StatusCode = statusCode;
Response = response;
Headers = headers;
} public override string ToString()
{
return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
}
} [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.17.21.0 (NJsonSchema v9.10.63.0 (Newtonsoft.Json v9.0.0.0))")]
public partial class SwaggerException<TResult> : SwaggerException
{
public TResult Result { get; private set; } public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException)
: base(message, statusCode, response, headers, innerException)
{
Result = result;
}
} }
ValuesClient
控制台调用示例代码
static void Main(string[] args)
{
var para = new InputValue { Id = };
ValuesClient vc = new ValuesClient("http://localhost/MvcWebApi01/");
var ret = vc.GetJsonValueAsync(para).Result;
}
asp.net mvc5中使用Swagger 自动生成WebApi文档笔记的更多相关文章
- go实践之swagger自动生成api文档
文章目录 go实践之swagger自动生成api文档 1.安装需要用到的包 2.接口代码支持swagger 3. 生成swagger接口 go实践之swagger自动生成api文档 作为一个后端开发, ...
- Asp.Net Core 轻松学-利用 Swagger 自动生成接口文档
前言 目前市场上主流的开发模式,几乎清一色的前后端分离方式,作为服务端开发人员,我们有义务提供给各个客户端良好的开发文档,以方便对接,减少沟通时间,提高开发效率:对于开发人员来说,编写接口文档 ...
- Asp.Net Core 轻松学系列-5利用 Swagger 自动生成接口文档
目录 前言 结语 源码下载 前言 目前市场上主流的开发模式,几乎清一色的前后端分离方式,作为服务端开发人员,我们有义务提供给各个客户端良好的开发文档,以方便对接,减少沟通时间,提高开发效率:对 ...
- .net core 使用swagger自动生成接口文档
前言 swagger是一个api文档自动生动工具,还集成了在线调试. 可以为项目自动生成接口文档, 非常的方便快捷 Swashbuckle.AspNetCore 是一个开源项目,用于生成 ASP.N ...
- springboot 集成 swagger 自动生成API文档
Swagger是一个规范和完整的框架,用于生成.描述.调用和可视化RESTful风格的Web服务.简单来说,Swagger是一个功能强大的接口管理工具,并且提供了多种编程语言的前后端分离解决方案. S ...
- springboot结合swagger自动生成接口文档
前后台分离的开发渐渐已成趋势.那么前后端的沟通就成了问题,包括移动端,web端.如果有一个东西在我们写完代码的时候,自动将接口的所有注释,调用文档提供出来,是不是一件很美好的事情.那就是使用swagg ...
- 使用Swagger自动生成API文档
⒈添加pom依赖 <!-- Swagger核心包,用于扫描程序生成文档数据 --> <dependency> <groupId>io.springfox</g ...
- Swagger自动生成接口文档
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://mave ...
- WebApi使用swagger ui自动生成接口文档
之前就写到.最近正在使用webapi.这里介绍一个实用的东西swageer ui现在开发都是前后端分开.我们这里是给前端提供api.有时候对于一个api的描述,并不想专门写一份文档.很浪费时间.swa ...
随机推荐
- python-markdown
python-markdown无法将“`生成标签问题解决方法 2种都是代码区块 ```swift is Int ``` is Int
- 动态改变Spring定时任务执行频率
@Component@EnableSchedulingpublic class updateCronTask implements SchedulingConfigurer { public stat ...
- s21day15 python笔记
s21day15 python笔记 一.内容回顾及补充 回顾 补充 range / xrange(python2与python3的区别六) python2: xrange:不会在内存中立即创建,而是在 ...
- unity---背景循环滚动
方法一:两张图无缝拼接 float speed = 3; void Update() { transform.Translate(Vector3.right * Time.deltaTime * sp ...
- Virtualbox 虚拟机安装Linux
背景:Win10系统 MSI主板 目标:基于Win10 利用虚拟机Virtualbox安装Linux 准备工作:Ctrl+Alt+Del打开任务管理器——>性能(查看CPU虚拟化是否开启) ...
- 20155219付颖卓《网络对抗》Exp6 信息搜集与漏洞扫描
基础问题回答 1.哪些组织负责DNS,IP的管理? 全球根服务器均由美国政府授权的ICANN统一管理,负责全球的域名根服务器.DNS和IP地址管理. 全球根域名服务器:绝大多数在欧洲和北美(全球13台 ...
- leetcode 刷题(2)--- 两数相加
给定两个非空链表来表示两个非负整数.位数按照逆序方式存储,它们的每个节点只存储单个数字.将两数相加返回一个新的链表. 你可以假设除了数字 0 之外,这两个数字都不会以零开头. 示例: 输入:(2 -& ...
- Apache Commons 工具类简单使用
Apache Commons包含了很多开源的工具,用于解决平时编程经常会遇到的问题,减少重复劳动.下面是我这几年做开发过程中自己用过的工具类做简单介绍. 组件 功能介绍 BeanUtils 提供了对于 ...
- javascript第一个作业之网页计算器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- centos安装实用总结
1.常用软件安装: yum install -y bash-completion vim lrzsz wget expect net-tools nc nmap tree dos2unix htop ...