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 quick fixes for obvious type errors #532

Open
remcohaszing opened this issue Aug 23, 2021 · 0 comments
Open

Add quick fixes for obvious type errors #532

remcohaszing opened this issue Aug 23, 2021 · 0 comments

Comments

@remcohaszing
Copy link
Contributor

Is your enhancement related to a problem? Please describe.

One of the arguments some people use who don’t like YAML, is that types are hard to deal with in YAML. Some strings need to be quoted in YAML, whereas others do not. I think this might be useful to them.

Describe the solution you would like

Based on schema validation, add quick actions to convert:

  • true or false to 'true' or 'false' if a string is expected
  • null to 'null' if a string is expected
  • Numbers to numeric strings if a string is expected
  • Dates and datetimes to strings if a string is expected
  • 'true' or 'false' to true or false to if a boolean is expected
  • 'null' or '' (empty string) to null if a null type is expected
  • Numeric strings to numbers if a number is expected
  • Single line objects to a quoted string if a string is expected
  • Multi line objects to a multiline string if a string is expected
  • Any invalid value to a valid value if an enum is expected

Describe alternatives you have considered

Autofix would also be possible, but I think the user should be in control.

Additional context

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

No branches or pull requests

2 participants