diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index 56f1b070717..4ac0fb93785 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -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}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache index 2eb7c9eb348..544411db910 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache @@ -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}} diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md index 877eda70283..1b2baab7156 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/README.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/AnotherFakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/AnotherFakeApi.md index bf404a2f491..838b304529f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/AnotherFakeApi.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md index eeb5fe39b18..e1fcf653973 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md @@ -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 | 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 | 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(); // Dictionary | 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(); // List | var ioutil = new List(); // List | var http = new List(); // List | diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeClassnameTags123Api.md index 3a241e3c631..0eb3b10acec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeClassnameTags123Api.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md index f8d05ec9396..23ccf5ec90f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/PetApi.md @@ -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 | 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(); // List | 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) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md index c5143852603..8be6beb2be6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/StoreApi.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md index 4588b440131..b546df8686d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/UserApi.md @@ -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(); // List | 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(); // List | 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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md index 222ac2d0d62..a3664cf3b1b 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/README.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/AnotherFakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/AnotherFakeApi.md index bf404a2f491..838b304529f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/AnotherFakeApi.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md index eeb5fe39b18..e1fcf653973 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md @@ -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 | 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 | 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(); // Dictionary | 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(); // List | var ioutil = new List(); // List | var http = new List(); // List | diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeClassnameTags123Api.md index 3a241e3c631..0eb3b10acec 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeClassnameTags123Api.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md index f8d05ec9396..23ccf5ec90f 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/PetApi.md @@ -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 | 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(); // List | 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) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md index c5143852603..8be6beb2be6 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/StoreApi.md @@ -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 diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md index 4588b440131..b546df8686d 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/UserApi.md @@ -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(); // List | 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(); // List | 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