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

Validation for data model for #switch section #689

Closed
angelozerr opened this issue Aug 1, 2022 · 0 comments · Fixed by #709
Closed

Validation for data model for #switch section #689

angelozerr opened this issue Aug 1, 2022 · 0 comments · Fixed by #709
Assignees
Milestone

Comments

@angelozerr
Copy link
Contributor

See https://quarkus.io/guides/qute-reference#when_section

Given:

{#switch person.name}
  {#case 'John'} 
    Hey John!
  {#case 'Mary'}
    Hey Mary!
  {#case 123}
{/switch}

Here person.name is a String, but last #case (which i sequals to 123) is a number, we should higlight 123 as an error to say that it is an unexpeced type.

We should support too enum like

{#when machine.status}
  {#is ON}
    It's running. 
  {#is in OFF BROKEN}
    It's broken or OFF. 
  {#is in BAD_ENUM_VAUE}
{/when}

BAD_ENUM_VAUE must be higlighted as en error. Please note that #is can have several values (OFF BROKEN)

@angelozerr angelozerr changed the title Support validation for data mode for #switch section Validation for data model for #switch section Aug 1, 2022
@angelozerr angelozerr added this to the 0.13.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants