From 4ffdadfbcc42054b87a29bd85f5f9d6e5ab440f1 Mon Sep 17 00:00:00 2001 From: itaru2622 <70509350+itaru2622@users.noreply.github.com> Date: Sat, 28 Jan 2023 13:03:17 +0900 Subject: [PATCH] [python-nextgen] fix issue on API example doc autogeneration (#14539) * [python-nextgen] fix template to make auto-generated example runnable when spec has no auth methods * update samples with ./bin/generate-samples.sh * add unit test code --- .../python-nextgen/api_doc_example.mustache | 5 --- .../PythonNextgenClientCodegenTest.java | 43 ++++++++++++++++++- .../docs/AnotherFakeApi.md | 2 +- .../python-nextgen-aiohttp/docs/DefaultApi.md | 2 +- .../python-nextgen-aiohttp/docs/FakeApi.md | 26 +++++------ .../python-nextgen-aiohttp/docs/StoreApi.md | 6 +-- .../python-nextgen-aiohttp/docs/UserApi.md | 16 +++---- .../python-nextgen/docs/AnotherFakeApi.md | 2 +- .../python-nextgen/docs/DefaultApi.md | 2 +- .../petstore/python-nextgen/docs/FakeApi.md | 26 +++++------ .../petstore/python-nextgen/docs/StoreApi.md | 6 +-- .../petstore/python-nextgen/docs/UserApi.md | 16 +++---- 12 files changed, 94 insertions(+), 58 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache b/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache index 59ceada0a8d1..d8b29f7bd6cf 100644 --- a/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache +++ b/modules/openapi-generator/src/main/resources/python-nextgen/api_doc_example.mustache @@ -7,12 +7,7 @@ from {{{packageName}}}.rest import ApiException from pprint import pprint {{> python_doc_auth_partial}} # Enter a context with an instance of the API client -{{#hasAuthMethods}} {{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient(configuration) as api_client: -{{/hasAuthMethods}} -{{^hasAuthMethods}} -{{#asyncio}}async {{/asyncio}}with {{{packageName}}}.ApiClient() as api_client: -{{/hasAuthMethods}} # Create an instance of the API class api_instance = {{{packageName}}}.{{{classname}}}(api_client) {{#allParams}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java index 38b2f97fd45e..d3a53938860f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java @@ -18,17 +18,28 @@ package org.openapitools.codegen.python; import com.google.common.collect.Sets; +import io.swagger.parser.OpenAPIParser; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.media.*; +import io.swagger.v3.parser.core.models.ParseOptions; import io.swagger.v3.parser.util.SchemaTypeUtil; import org.openapitools.codegen.*; import org.openapitools.codegen.languages.PythonNextgenClientCodegen; +import org.openapitools.codegen.languages.features.CXFServerFeatures; +import static org.openapitools.codegen.TestUtils.assertFileContains; +import static org.openapitools.codegen.TestUtils.assertFileExists; +import org.openapitools.codegen.TestUtils; import org.testng.Assert; import org.testng.annotations.Test; - +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; public class PythonNextgenClientCodegenTest { @@ -382,4 +393,34 @@ public class PythonNextgenClientCodegenTest { Assert.assertEquals(cm.parent, null); Assert.assertEquals(cm.imports.size(), 0); } + @Test(description ="check API example has input param(configuration) when it creates api_client") + public void apiExampleDocTest() throws Exception { + final DefaultCodegen codegen = new PythonNextgenClientCodegen(); + final String outputPath = generateFiles(codegen, "src/test/resources/3_0/generic.yaml"); + final Path p = Paths.get(outputPath + "docs/DefaultApi.md"); + + assertFileExists(p); + assertFileContains(p, "openapi_client.ApiClient(configuration) as api_client"); + } + + // Helper function, intended to reduce boilerplate + static private String generateFiles(DefaultCodegen codegen, String filePath) throws IOException { + final File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + final String outputPath = output.getAbsolutePath().replace('\\', '/'); + + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true"); + + final ClientOptInput input = new ClientOptInput(); + final OpenAPI openAPI = new OpenAPIParser().readLocation(filePath, null, new ParseOptions()).getOpenAPI(); + input.openAPI(openAPI); + input.config(codegen); + + final DefaultGenerator generator = new DefaultGenerator(); + final List files = generator.opts(input).generate(); + + Assert.assertTrue(files.size() > 0); + return outputPath + "/"; + } } diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md index 1fd1a5a9a193..fc7fc266d505 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/AnotherFakeApi.md @@ -31,7 +31,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.AnotherFakeApi(api_client) client = petstore_api.Client() # Client | client model diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md index 41dcdbd86316..826ebf49a1a5 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/DefaultApi.md @@ -29,7 +29,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.DefaultApi(api_client) diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md index a8500c31411e..ec535815a32b 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/FakeApi.md @@ -44,7 +44,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) @@ -232,7 +232,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = True # bool | Input boolean as post body (optional) @@ -295,7 +295,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) @@ -358,7 +358,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = 3.4 # float | Input number as post body (optional) @@ -421,7 +421,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = 'body_example' # str | Input string as post body (optional) @@ -484,7 +484,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body @@ -547,7 +547,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = 'body_example' # str | image to upload @@ -608,7 +608,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | @@ -667,7 +667,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) query = 'query_example' # str | @@ -730,7 +730,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) client = petstore_api.Client() # Client | client model @@ -976,7 +976,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) request_body = {'key': 'request_body_example'} # Dict[str, str] | request body @@ -1038,7 +1038,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) param = 'param_example' # str | field1 @@ -1102,7 +1102,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) pipe = ['pipe_example'] # List[str] | diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md index 32cfe8a8f149..44f6b7e07c00 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/StoreApi.md @@ -34,7 +34,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.StoreApi(api_client) order_id = 'order_id_example' # str | ID of the order that needs to be deleted @@ -168,7 +168,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.StoreApi(api_client) order_id = 56 # int | ID of pet that needs to be fetched @@ -234,7 +234,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.StoreApi(api_client) order = petstore_api.Order() # Order | order placed for purchasing the pet diff --git a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md index cd85a9ce5cc0..caf35cc14c72 100644 --- a/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-nextgen-aiohttp/docs/UserApi.md @@ -38,7 +38,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) user = petstore_api.User() # User | Created user object @@ -100,7 +100,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) user = [petstore_api.User()] # List[User] | List of user object @@ -162,7 +162,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) user = [petstore_api.User()] # List[User] | List of user object @@ -224,7 +224,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be deleted @@ -287,7 +287,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. @@ -353,7 +353,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | The user name for login @@ -420,7 +420,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) @@ -478,7 +478,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -async with petstore_api.ApiClient() as api_client: +async with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md index b97da84dfbe4..9691c105ac6a 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/AnotherFakeApi.md @@ -31,7 +31,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.AnotherFakeApi(api_client) client = petstore_api.Client() # Client | client model diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md index d81c9dd7a92a..c7ebf52f727e 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/DefaultApi.md @@ -29,7 +29,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.DefaultApi(api_client) diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md index 191b1ab4676e..f218e044bc00 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/FakeApi.md @@ -44,7 +44,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) @@ -232,7 +232,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = True # bool | Input boolean as post body (optional) @@ -295,7 +295,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) outer_composite = petstore_api.OuterComposite() # OuterComposite | Input composite as post body (optional) @@ -358,7 +358,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = 3.4 # float | Input number as post body (optional) @@ -421,7 +421,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = 'body_example' # str | Input string as post body (optional) @@ -484,7 +484,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) outer_object_with_enum_property = petstore_api.OuterObjectWithEnumProperty() # OuterObjectWithEnumProperty | Input enum (int) as post body @@ -547,7 +547,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) body = 'body_example' # str | image to upload @@ -608,7 +608,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) file_schema_test_class = petstore_api.FileSchemaTestClass() # FileSchemaTestClass | @@ -667,7 +667,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) query = 'query_example' # str | @@ -730,7 +730,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) client = petstore_api.Client() # Client | client model @@ -976,7 +976,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) request_body = {'key': 'request_body_example'} # Dict[str, str] | request body @@ -1038,7 +1038,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) param = 'param_example' # str | field1 @@ -1102,7 +1102,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) pipe = ['pipe_example'] # List[str] | diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md index 6c1b3c12661f..65b1d85fa0c3 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/StoreApi.md @@ -34,7 +34,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.StoreApi(api_client) order_id = 'order_id_example' # str | ID of the order that needs to be deleted @@ -168,7 +168,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.StoreApi(api_client) order_id = 56 # int | ID of pet that needs to be fetched @@ -234,7 +234,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.StoreApi(api_client) order = petstore_api.Order() # Order | order placed for purchasing the pet diff --git a/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md b/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md index 723ddf83ab7d..c7a40e8499d7 100755 --- a/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-nextgen/docs/UserApi.md @@ -38,7 +38,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) user = petstore_api.User() # User | Created user object @@ -100,7 +100,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) user = [petstore_api.User()] # List[User] | List of user object @@ -162,7 +162,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) user = [petstore_api.User()] # List[User] | List of user object @@ -224,7 +224,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be deleted @@ -287,7 +287,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | The name that needs to be fetched. Use user1 for testing. @@ -353,7 +353,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | The user name for login @@ -420,7 +420,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) @@ -478,7 +478,7 @@ configuration = petstore_api.Configuration( # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted