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

[DART] We need a flag to generate models with json annotation #2040

Open
Driky opened this issue Feb 13, 2024 · 4 comments
Open

[DART] We need a flag to generate models with json annotation #2040

Driky opened this issue Feb 13, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Driky
Copy link

Driky commented Feb 13, 2024

Reason/Context

Why we need this improvement?

A very common use-case when generating model is the serialization/deserialization to/from json. Currently this is not covered by the cli even tough modelina supports it.

How will this change help?

With this change we save time on several points:

  • Right now we have to edit model by hand to add json annotations
  • Code written by hand is lost on subsequent model generation

Description

What changes have to be introduced?

From a quick look at src/commands/generate/models.ts:

  • we would need a new flag to indicate if we want to generate the model with the serialization annotations ex: --dart-json-annotations
  • the case handling the dart generation would need to handle the new flag. This example seems to show how to apply the right configuration when instantiating the model generator
Will this be a breaking change?

No, this would add an optional flag. Old script would still work.

How could it be implemented/designed?

See example mentioned previously

@Driky Driky added the enhancement New feature or request label Feb 13, 2024
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.

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 13, 2024
@jonaslagoni
Copy link
Member

@derberg do you mind transferring this to Modelina 🙂

@derberg derberg transferred this issue from asyncapi/cli Jun 13, 2024
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.

@github-actions github-actions bot removed the stale label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants