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

Quotes missing on parameter values #971

Closed
joshdreagan opened this issue Mar 21, 2024 · 1 comment · Fixed by #984
Closed

Quotes missing on parameter values #971

joshdreagan opened this issue Mar 21, 2024 · 1 comment · Fixed by #984
Assignees
Labels
bug Something isn't working source code editor Source Code Editor-related issues
Milestone

Comments

@joshdreagan
Copy link

Describe the Bug

Noticed that Kaoto doesn't always quote values when it might need to. For instance, for the REST Component, there's a bindingMode parameter. It's an enum and one of the possible values is "off". So Kaoto generates bindingMode: off instead of bindingMode: "off". Which causes the YAML to interpret the value as "false" instead of the literal "off".

Steps to Reproduce the Bug or Issue

  1. Create a new route
  2. Add a rest producer
  3. Set the bindingMode parameter to "off"
  4. Inspect the YAML

Screenshots or Videos

No response

Platform

  • OS: all
  • Browser: all
  • Version: 0.14.0
@joshdreagan joshdreagan added the bug Something isn't working label Mar 21, 2024
@igarashitm
Copy link
Contributor

Note: In YAML 1.1, off is translated to boolean false
https://yaml.org/type/bool.html

YAML 1.2 doesn't do that
https://yaml.org/spec/1.2.2/#10212-boolean

We would need to quote the off anyway...

@lordrip lordrip added the source code editor Source Code Editor-related issues label Mar 29, 2024
@lordrip lordrip moved this from New to Todo in Kanban Board Mar 29, 2024
@lordrip lordrip added this to the 2.0.0 TP3 milestone Mar 29, 2024
@lordrip lordrip self-assigned this Mar 29, 2024
@lordrip lordrip moved this from Todo to In Progress in Kanban Board Mar 29, 2024
lordrip added a commit to lordrip/kaoto that referenced this issue Mar 30, 2024
Currently, Kaoto serialize to YAML using YAML 1.2.

This creates an edge for the Rest component since one of its parameters
(`bindingMode`) accepts an `off` value which ultimately gets serialized as it is,
causing to be interpreted as `false`.

This commit change the YAML serializing schema to 1.1 so `off` gets serialized as `"off"`
avoiding this issue.

fix: KaotoIO#971
@lordrip lordrip moved this from In Progress to In Review in Kanban Board Mar 30, 2024
@lhein lhein closed this as completed in #984 Apr 2, 2024
lhein pushed a commit that referenced this issue Apr 2, 2024
Currently, Kaoto serialize to YAML using YAML 1.2.

This creates an edge for the Rest component since one of its parameters
(`bindingMode`) accepts an `off` value which ultimately gets serialized as it is,
causing to be interpreted as `false`.

This commit change the YAML serializing schema to 1.1 so `off` gets serialized as `"off"`
avoiding this issue.

fix: #971
@github-project-automation github-project-automation bot moved this from In Review to Done in Kanban Board Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working source code editor Source Code Editor-related issues
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants