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

feat: convert untyped json from any to unknown #112

Closed
Tracked by #131
arthurfiorette opened this issue Jul 10, 2023 Discussed in #110 · 1 comment · Fixed by #131
Closed
Tracked by #131

feat: convert untyped json from any to unknown #112

arthurfiorette opened this issue Jul 10, 2023 Discussed in #110 · 1 comment · Fixed by #131
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@arthurfiorette
Copy link
Owner

Discussed in #110

Add a strictJson property to when Json fields are found without any /// [Type] comment, they should be changed to unknown. Also need to discuss whether it should be enabled by default, breaking change but increases type safety (which kind is what this package is aiming to help with), or not.

Implementation details:

Probably start with:

These two IFs ignores the field type in case the model comment could not be found (a.k.a json field without type comment), probably there you'll also need to call the function to change the types, but this time, using 'unknown' if the strictJson property is enabled.

@arthurfiorette arthurfiorette added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jul 10, 2023
@arthurfiorette arthurfiorette self-assigned this Jul 10, 2023
@arthurfiorette arthurfiorette linked a pull request Aug 10, 2023 that will close this issue
26 tasks
@arthurfiorette
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant