Bug Report Checklist
Description
When using an SchemaObject, that contains the additionalProperties attribute with type: object, I get the error:
AttributeError: type object 'MetaOapg' has no attribute 'additional_properties'.
As I have tested this, I have come to the conclusion that this only occurs, when there are other Schemas with additionalProperties defined.
openapi-generator version
Version 6.3.0 Python
OpenAPI declaration file content or url
This my minimal Example to reproduce the bug
openapi: 3.0.0
info:
version: 1.0.0
title: issue 13997 spec
license:
name: Apache-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
servers: []
tags: []
paths: {}
components:
schemas:
Event:
type: object
required:
- apiVersion
- modules
properties:
apiVersion:
type: string
timeout:
type: integer
format: int32
example: 10000
modules:
type: object
additionalProperties:
type: object
UploadEvent:
type: object
properties:
uploadId:
type: string
example: "6Ms5S3"
result:
type: object
additionalProperties:
type: array
items:
type: object
And for some reason this works (without the second event):
openapi: 3.0.0
info:
version: 1.0.0
title: issue 13997 spec
license:
name: Apache-2.0
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
servers: []
tags: []
paths: {}
components:
schemas:
Event:
type: object
required:
- apiVersion
- modules
properties:
apiVersion:
type: string
timeout:
type: integer
format: int32
example: 10000
modules:
type: object
additionalProperties:
type: object
Generation Details
java -jar openapi-generator-cli-6.3.0.jar generate -i additional.yaml -g python
Steps to reproduce
Generate with specified yaml file above and try to import Event like: from openapi_client.model.event import Event
Complete Stacktrace
Traceback (most recent call last):
File "sample.py", line 2, in <module>
from devaice_web_api_client.model.event import Event
File "/home/user/.local/lib/python3.8/site-packages/openapi_client/model/event.py", line 26, in <module>
class Event(
File "/home/user/.local/lib/python3.8/site-packages/openapi_client/model/event.py", line 36, in Event
class MetaOapg:
File "/home/user/.local/lib/python3.8/site-packages/openapi_client/model/event.py", line 42, in MetaOapg
class properties:
File "/home/user/.local/lib/python3.8/site-packages/openapi_client/model/event.py", line 46, in properties
class modules(
File "/home/user/.local/lib/python3.8/site-packages/openapi_client/model/event.py", line 65, in modules
**kwargs: typing.Union[MetaOapg.additional_properties, dict, frozendict.frozendict, ],
AttributeError: type object 'MetaOapg' has no attribute 'additional_properties'
Synonym issue from OpenAPITools/openapi-generator#14078
Thank you @Poolmann
Bug Report Checklist
Description
When using an SchemaObject, that contains the
additionalPropertiesattribute withtype: object, I get the error:AttributeError: type object 'MetaOapg' has no attribute 'additional_properties'.As I have tested this, I have come to the conclusion that this only occurs, when there are other Schemas with
additionalPropertiesdefined.openapi-generator version
Version 6.3.0 Python
OpenAPI declaration file content or url
This my minimal Example to reproduce the bug
And for some reason this works (without the second event):
Generation Details
java -jar openapi-generator-cli-6.3.0.jar generate -i additional.yaml -g pythonSteps to reproduce
Generate with specified yaml file above and try to import Event like:
from openapi_client.model.event import EventComplete Stacktrace
Synonym issue from OpenAPITools/openapi-generator#14078
Thank you @Poolmann