Fix list examples in Python (for real) (#8034)

The patch in #7967 forgot the prefix, this fixes it, and change the
sampels so that we can see the effect this time.
This commit is contained in:
Thomas Hervé
2020-11-26 23:28:27 +01:00
committed by GitHub
parent 9334909bcd
commit 3f75691da2
3 changed files with 3 additions and 4 deletions

View File

@@ -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();

View File

@@ -133,6 +133,7 @@ paths:
type: array
items:
type: string
example: ['tag1', 'tag2']
responses:
'200':
description: successful operation

View File

@@ -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: