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 · 0 comments
Open

Update Dart Model Generation Command to Support Optional Fields #2471

bhanuka96 opened this issue Jan 13, 2024 · 0 comments

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.

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

No branches or pull requests

1 participant