-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] generates broken Python code, default kwarg repeated #2174
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
Moved to |
Glancing over the code I can spot https://github.com/asyncapi/modelina/blob/master/src/generators/python/presets/Pydantic.ts#L53 and https://github.com/asyncapi/modelina/blob/master/src/generators/python/presets/Pydantic.ts#L62 - if I interpret this correctly, it means that this can happen when Looks like this bug has been introduced with e9e46b3 two days ago o_Ò So the second time Hence, I guess the fix would be to just drop L62-64. |
Thanks for the fix - looking forward to it. |
Describe the bug.
I just bumped
"@asyncapi/cli": "2.14.1"
to"@asyncapi/cli": "2.16.0"
and was surprised to see my tests fail, cuz I didn't see any relevant changes in the release notes.What I found was that there are now serializers and validators, which seems fine, but
asyncapi generate models python doc/asyncapi.yaml --pyDantic
generates broken code now:The kwarg
default
is repeated everywhere.(It also has some unused imports, which bugs me a little :D)
Expected behavior
Generates valid Python code.
Screenshots
How to Reproduce
$ref
https://raw.githubusercontent.com/cloudevents/spec/v1.0.2/cloudevents/formats/cloudevents.json🥦 Browser
None
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: