forked from loafle/openapi-generator-original
Fix the null pointer exception when generating examples for schemas in python-experimental (#12019)
* Improves example generator for python-experimental * Fixes quotes around date example * Improves object schema examplple gen * Samples regenerated * Adds back in AnyType + oneOf discriminator handling * Reverts version file * Returns early in example gen for array composed schemas * Adds toExampleValue method to python-exp * Improves pattern regex sample generation in python-experimental * Fixes comment typo
This commit is contained in:
@@ -766,7 +766,7 @@ with petstore_api.ApiClient(configuration) as api_client:
|
||||
api_instance = fake_api.FakeApi(api_client)
|
||||
|
||||
# example passing only optional values
|
||||
body = ComposedOneOfDifferentTypes()
|
||||
body = ComposedOneOfDifferentTypes(None)
|
||||
try:
|
||||
api_response = api_instance.composed_one_of_different_types(
|
||||
body=body,
|
||||
@@ -866,12 +866,12 @@ with petstore_api.ApiClient(configuration) as api_client:
|
||||
number=32.1,
|
||||
_float=3.14,
|
||||
double=67.8,
|
||||
string="a",
|
||||
pattern_without_delimiter="AUR,rZ#UM/?R,Fp^l6$ARjbhJk C",
|
||||
string="A",
|
||||
pattern_without_delimiter="Aj",
|
||||
byte='YQ==',
|
||||
binary=open('/path/to/file', 'rb'),
|
||||
date=isoparse('1970-01-01').date(),
|
||||
date_time=isoparse('2020-02-02T20:20:20.22222Z'),
|
||||
date="1970-01-01",
|
||||
date_time="2020-02-02T20:20:20.222220Z",
|
||||
password="password_example",
|
||||
callback="callback_example",
|
||||
)
|
||||
@@ -911,7 +911,7 @@ Name | Type | Description | Notes
|
||||
**byte** | **str** | None |
|
||||
**binary** | **file_type** | None | [optional]
|
||||
**date** | **date** | None | [optional]
|
||||
**dateTime** | **datetime** | None | [optional] if omitted the server will use the default value of isoparse('2010-02-01T10:20:10.11111+01:00')
|
||||
**dateTime** | **datetime** | None | [optional] if omitted the server will use the default value of 2010-02-01T10:20:10.11111+01:00
|
||||
**password** | **str** | None | [optional]
|
||||
**callback** | **str** | None | [optional]
|
||||
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
|
||||
@@ -1434,12 +1434,12 @@ with petstore_api.ApiClient(configuration) as api_client:
|
||||
|
||||
# example passing only optional values
|
||||
query_params = {
|
||||
'compositionAtRoot': ,
|
||||
'compositionAtRoot': None,
|
||||
'compositionInProperty': dict(
|
||||
some_prop=,
|
||||
some_prop=None,
|
||||
),
|
||||
}
|
||||
body =
|
||||
body = None
|
||||
try:
|
||||
# testing composed schemas at inline locations
|
||||
api_response = api_instance.inline_composition(
|
||||
|
||||
Reference in New Issue
Block a user