diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index 23016b2bba67..c113ecf5c200 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -1050,7 +1050,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen { } else if (ModelUtils.isArraySchema(schema)) { if (objExample instanceof Iterable) { // If the example is already a list, return it directly instead of wrongly wrap it in another list - return objExample.toString(); + return fullPrefix + objExample.toString(); } ArraySchema arrayschema = (ArraySchema) schema; Schema itemSchema = arrayschema.getItems(); diff --git a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 81717a8790dd..fa3500df0a1b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -133,6 +133,7 @@ paths: type: array items: type: string + example: ['tag1', 'tag2'] responses: '200': description: successful operation diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md index 21323c72c953..3ed215ecf615 100644 --- a/samples/openapi3/client/petstore/python/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/PetApi.md @@ -477,9 +477,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - tags = [ - "tags_example", - ] # [str] | Tags to filter by + tags = ["tag1","tag2"] # [str] | Tags to filter by # example passing only required values which don't have defaults set try: