Skip to content
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

Add attrs and/or dataclasses presets to Python generator #999

Open
tokarenko opened this issue Nov 17, 2022 · 11 comments
Open

Add attrs and/or dataclasses presets to Python generator #999

tokarenko opened this issue Nov 17, 2022 · 11 comments
Labels
area/typescript Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. enhancement New feature or request good first issue Good for newcomers Python generator Anything related to the Python generator stale

Comments

@tokarenko
Copy link

Reason/Context

Please try answering few of those questions

Description

Please try answering few of those questions

  • What changes have to be introduced? Add attrs and/or dataclasses presets to Python generator
  • Will this be a breaking change? No
  • How could it be implemented/designed? -
@tokarenko tokarenko added the enhancement New feature or request label Nov 17, 2022
@github-actions
Copy link
Contributor

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.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@jonaslagoni
Copy link
Member

Thanks for the feature request @tokarenko! That sounds like a good improvement 🔥 Are you willing to try and provide it?

How to contribute a new preset is still in progress, but you can get a preview here.

@tokarenko
Copy link
Author

Thank you for welcoming my enhancement request and your suggestion to join efforts. I will not be able to help because I have no experience with Node.js and I am quite limited in time at the moment... You are doing a great job here and I am trying to use it to enhance my Python project with AsyncAPI descriptions and code generation.

@jonaslagoni
Copy link
Member

@tokarenko do you have an example you can provide of an output you are looking for? Maybe based on some example input?

I would love to convert this into a good-first-issue to make it more likely to be picked up 🙂

@tokarenko
Copy link
Author

Please check generator at https://app.quicktype.io/ with the following settings:
"Source type" = "JSON schema"
"Language" = "Python"
"Version" = "3.7"
"Classes only" = selected

@jonaslagoni jonaslagoni added the Python generator Anything related to the Python generator label Feb 20, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Jun 21, 2023
@ankur0904
Copy link
Contributor

@jonaslagoni Does this issue still valid? I want to work on this issue but need some guidance.

@jonaslagoni
Copy link
Member

It is @ankur0904, however I cant give much. If all it is is adding @dataclass in front of the class syntax then it should be straight forward, but it all depends on how much you need to change 🙂

Here is the generic approach to solving this issue:

  1. Determine the proper data models that you want to generate
  2. Add a new Python preset: https://github.com/asyncapi/modelina/blob/master/docs/contributing.md#adding-a-new-preset
  3. Adapt the preset so it generate the right output: https://github.com/asyncapi/modelina/blob/master/docs/presets.md
  4. Add an example for the new preset: https://github.com/asyncapi/modelina/blob/master/docs/contributing.md#adding-examples
  5. Adapt the docs

That should be it 🙂

@ankur0904
Copy link
Contributor

@jonaslagoni Thanks for your detailed insight.

@github-actions github-actions bot removed the stale label Jan 10, 2024
@jonaslagoni jonaslagoni added good first issue Good for newcomers area/typescript Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. labels Jan 12, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 3, 2025

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/typescript Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. enhancement New feature or request good first issue Good for newcomers Python generator Anything related to the Python generator stale
Projects
None yet
Development

No branches or pull requests

3 participants