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

Update Dart Model Generation Command to Support Optional Fields #2471

Open
bhanuka96 opened this issue Jan 13, 2024 · 1 comment
Open

Update Dart Model Generation Command to Support Optional Fields #2471

bhanuka96 opened this issue Jan 13, 2024 · 1 comment
Labels
bug Dart Dart Output

Comments

@bhanuka96
Copy link

bhanuka96 commented Jan 13, 2024

I have been using the following command to generate Dart model classes locally:

npm start -- "--lang dart --null-safety --final-props --copy-with -o jsons/sample.dart jsons/sample.json"

While the command works well, I noticed that all generated fields are marked as required, even when I haven't explicitly specified them as required arguments.

Expected Behavior:
The command should generate Dart model classes with optional fields for those properties that are not marked as required in the JSON schema.

@inferrinizzard inferrinizzard added Dart Dart Output bug labels May 22, 2024
@inferrinizzard
Copy link
Contributor

Hi @bhanuka96 , could you help to provide an example of your input and output as well as the expected output ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Dart Dart Output
Projects
None yet
Development

No branches or pull requests

2 participants