fix csharp-netcore doc (#4987)

This commit is contained in:
William Cheng 2020-01-14 14:11:35 +08:00 committed by GitHub
parent bf24d646c5
commit 0344f14e9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 276 additions and 198 deletions

View File

@ -93,28 +93,29 @@ namespace Example
public static void Main()
{
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
Configuration.Default.BasePath = "{{{basePath}}}";
Configuration config = new Configuration();
config.BasePath = "{{{basePath}}}";
{{#hasAuthMethods}}
{{#authMethods}}
{{#isBasic}}
// Configure HTTP basic authorization: {{{name}}}
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
{{/isBasic}}
{{#isApiKey}}
// Configure API key authorization: {{{name}}}
Configuration.Default.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
config.ApiKey.Add("{{{keyParamName}}}", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");
// config.ApiKeyPrefix.Add("{{{keyParamName}}}", "Bearer");
{{/isApiKey}}
{{#isOAuth}}
// Configure OAuth2 access token for authorization: {{{name}}}
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
{{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}}
var apiInstance = new {{classname}}(Configuration.Default);
var apiInstance = new {{classname}}(config);
{{#allParams}}
{{#isPrimitiveType}}
var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}

View File

@ -32,28 +32,29 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "{{{basePath}}}";
Configuration config = new Configuration();
config.BasePath = "{{{basePath}}}";
{{#hasAuthMethods}}
{{#authMethods}}
{{#isBasic}}
// Configure HTTP basic authorization: {{{name}}}
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
{{/isBasic}}
{{#isApiKey}}
// Configure API key authorization: {{{name}}}
Configuration.Default.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY");
config.AddApiKey("{{{keyParamName}}}", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer");
// config.AddApiKeyPrefix("{{{keyParamName}}}", "Bearer");
{{/isApiKey}}
{{#isOAuth}}
// Configure OAuth2 access token for authorization: {{{name}}}
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
{{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}}
var apiInstance = new {{classname}}(Configuration.Default);
var apiInstance = new {{classname}}(config);
{{#allParams}}
{{#isPrimitiveType}}
var {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}}{{^required}} (optional) {{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}

View File

@ -61,8 +61,9 @@ namespace Example
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var body = new ModelClient(); // ModelClient | client model
try

View File

@ -29,8 +29,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var body = new ModelClient(); // ModelClient | client model
try

View File

@ -42,8 +42,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var xmlItem = new XmlItem(); // XmlItem | XmlItem Body
try
@ -110,8 +111,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = true; // bool? | Input boolean as post body (optional)
try
@ -178,8 +180,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
try
@ -246,8 +249,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = 8.14; // decimal? | Input number as post body (optional)
try
@ -314,8 +318,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = body_example; // string | Input string as post body (optional)
try
@ -382,8 +387,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = new FileSchemaTestClass(); // FileSchemaTestClass |
try
@ -447,8 +453,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var query = query_example; // string |
var body = new User(); // User |
@ -516,8 +523,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = new ModelClient(); // ModelClient | client model
try
@ -585,12 +593,13 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure HTTP basic authorization: http_basic_test
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new FakeApi(Configuration.Default);
var apiInstance = new FakeApi(config);
var number = 8.14; // decimal | None
var _double = 1.2D; // double | None
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
@ -684,8 +693,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var enumHeaderStringArray = enumHeaderStringArray_example; // List<string> | Header parameter enum test (string array) (optional)
var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg)
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
@ -767,8 +777,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringGroup = 56; // int | Required String in group parameters
var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
var requiredInt64Group = 789; // long | Required Integer in group parameters
@ -843,8 +854,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var param = new Dictionary<string, string>(); // Dictionary<string, string> | request body
try
@ -909,8 +921,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var param = param_example; // string | field1
var param2 = param2_example; // string | field2
@ -979,8 +992,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var pipe = new List<string>(); // List<string> |
var ioutil = new List<string>(); // List<string> |
var http = new List<string>(); // List<string> |

View File

@ -29,13 +29,14 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key_query
Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY");
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer");
// config.AddApiKeyPrefix("api_key_query", "Bearer");
var apiInstance = new FakeClassnameTags123Api(Configuration.Default);
var apiInstance = new FakeClassnameTags123Api(config);
var body = new ModelClient(); // ModelClient | client model
try

View File

@ -35,11 +35,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try
@ -105,11 +106,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | Pet id to delete
var apiKey = apiKey_example; // string | (optional)
@ -179,11 +181,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var status = status_example; // List<string> | Status values that need to be considered for filter
try
@ -252,11 +255,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var tags = new List<string>(); // List<string> | Tags to filter by
try
@ -325,13 +329,14 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet to return
try
@ -399,11 +404,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try
@ -471,11 +477,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet that needs to be updated
var name = name_example; // string | Updated name of the pet (optional)
var status = status_example; // string | Updated status of the pet (optional)
@ -544,11 +551,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet to update
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional)
@ -618,11 +626,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet to update
var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)

View File

@ -32,8 +32,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = orderId_example; // string | ID of the order that needs to be deleted
try
@ -101,13 +102,14 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new StoreApi(Configuration.Default);
var apiInstance = new StoreApi(config);
try
{
@ -171,8 +173,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = 789; // long | ID of pet that needs to be fetched
try
@ -240,8 +243,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var body = new Order(); // Order | order placed for purchasing the pet
try

View File

@ -36,8 +36,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var body = new User(); // User | Created user object
try
@ -102,8 +103,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var body = new List<User>(); // List<User> | List of user object
try
@ -168,8 +170,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var body = new List<User>(); // List<User> | List of user object
try
@ -236,8 +239,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | The name that needs to be deleted
try
@ -303,8 +307,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
try
@ -372,8 +377,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | The user name for login
var password = password_example; // string | The password for login in clear text
@ -442,8 +448,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
try
{
@ -506,8 +513,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | name that need to be deleted
var body = new User(); // User | Updated user object

View File

@ -73,8 +73,9 @@ namespace Example
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var body = new ModelClient(); // ModelClient | client model
try

View File

@ -29,8 +29,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var body = new ModelClient(); // ModelClient | client model
try

View File

@ -42,8 +42,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var xmlItem = new XmlItem(); // XmlItem | XmlItem Body
try
@ -110,8 +111,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = true; // bool? | Input boolean as post body (optional)
try
@ -178,8 +180,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
try
@ -246,8 +249,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = 8.14; // decimal? | Input number as post body (optional)
try
@ -314,8 +318,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = body_example; // string | Input string as post body (optional)
try
@ -382,8 +387,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = new FileSchemaTestClass(); // FileSchemaTestClass |
try
@ -447,8 +453,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var query = query_example; // string |
var body = new User(); // User |
@ -516,8 +523,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var body = new ModelClient(); // ModelClient | client model
try
@ -585,12 +593,13 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure HTTP basic authorization: http_basic_test
Configuration.Default.Username = "YOUR_USERNAME";
Configuration.Default.Password = "YOUR_PASSWORD";
config.Username = "YOUR_USERNAME";
config.Password = "YOUR_PASSWORD";
var apiInstance = new FakeApi(Configuration.Default);
var apiInstance = new FakeApi(config);
var number = 8.14; // decimal | None
var _double = 1.2D; // double | None
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
@ -684,8 +693,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var enumHeaderStringArray = enumHeaderStringArray_example; // List<string> | Header parameter enum test (string array) (optional)
var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg)
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
@ -767,8 +777,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var requiredStringGroup = 56; // int | Required String in group parameters
var requiredBooleanGroup = true; // bool | Required Boolean in group parameters
var requiredInt64Group = 789; // long | Required Integer in group parameters
@ -843,8 +854,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var param = new Dictionary<string, string>(); // Dictionary<string, string> | request body
try
@ -909,8 +921,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var param = param_example; // string | field1
var param2 = param2_example; // string | field2
@ -979,8 +992,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new FakeApi(config);
var pipe = new List<string>(); // List<string> |
var ioutil = new List<string>(); // List<string> |
var http = new List<string>(); // List<string> |

View File

@ -29,13 +29,14 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key_query
Configuration.Default.AddApiKey("api_key_query", "YOUR_API_KEY");
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer");
// config.AddApiKeyPrefix("api_key_query", "Bearer");
var apiInstance = new FakeClassnameTags123Api(Configuration.Default);
var apiInstance = new FakeClassnameTags123Api(config);
var body = new ModelClient(); // ModelClient | client model
try

View File

@ -35,11 +35,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try
@ -105,11 +106,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | Pet id to delete
var apiKey = apiKey_example; // string | (optional)
@ -179,11 +181,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var status = status_example; // List<string> | Status values that need to be considered for filter
try
@ -252,11 +255,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var tags = new List<string>(); // List<string> | Tags to filter by
try
@ -325,13 +329,14 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet to return
try
@ -399,11 +404,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var body = new Pet(); // Pet | Pet object that needs to be added to the store
try
@ -471,11 +477,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet that needs to be updated
var name = name_example; // string | Updated name of the pet (optional)
var status = status_example; // string | Updated status of the pet (optional)
@ -544,11 +551,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet to update
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional)
@ -618,11 +626,12 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(Configuration.Default);
var apiInstance = new PetApi(config);
var petId = 789; // long | ID of pet to update
var requiredFile = BINARY_DATA_HERE; // System.IO.Stream | file to upload
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)

View File

@ -32,8 +32,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = orderId_example; // string | ID of the order that needs to be deleted
try
@ -101,13 +102,14 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
Configuration.Default.AddApiKey("api_key", "YOUR_API_KEY");
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("api_key", "Bearer");
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new StoreApi(Configuration.Default);
var apiInstance = new StoreApi(config);
try
{
@ -171,8 +173,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = 789; // long | ID of pet that needs to be fetched
try
@ -240,8 +243,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var body = new Order(); // Order | order placed for purchasing the pet
try

View File

@ -36,8 +36,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var body = new User(); // User | Created user object
try
@ -102,8 +103,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var body = new List<User>(); // List<User> | List of user object
try
@ -168,8 +170,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var body = new List<User>(); // List<User> | List of user object
try
@ -236,8 +239,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | The name that needs to be deleted
try
@ -303,8 +307,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
try
@ -372,8 +377,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | The user name for login
var password = password_example; // string | The password for login in clear text
@ -442,8 +448,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
try
{
@ -506,8 +513,9 @@ namespace Example
{
public static void Main()
{
Configuration.Default.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(Configuration.Default);
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = username_example; // string | name that need to be deleted
var body = new User(); // User | Updated user object