KaotoIO / kaoto

The UI of the Kaoto project
https://kaoto.io
Apache License 2.0
38 stars 29 forks source link

feat(ConfigForm): Add support for oneOf fields #1551

Closed lordrip closed 1 month ago

lordrip commented 1 month ago

Context

Currently, we have partial support for the oneOf schemas.

This commit cleans up the generated schemas, by removing the not definition from oneOf and also removing the empty properties like:

{
  property: { }
}

Test the changes live: https://lordrip.github.io/kaoto/

- errorHandler: {}

fix: https://github.com/KaotoIO/kaoto/issues/1550 fix: https://github.com/KaotoIO/kaoto/issues/948

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 92.15686% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@f95f50e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...catalog/generator/CamelYamlDslSchemaProcessor.java 88.57% 3 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1551 +/- ## ======================================= Coverage ? 80.02% Complexity ? 272 ======================================= Files ? 276 Lines ? 7825 Branches ? 1496 ======================================= Hits ? 6262 Misses ? 1502 Partials ? 61 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lordrip commented 1 month ago

I do not understand what to look at and verify exactly. What is modified functionally?

Adding support for oneOf elements in the JSON Schema, used by errorHandler, the new tokenizer EIP, among others. If you check Camel 4.9.0-SNAPSHOT, you'll notice that the tokenizer doesn't show any tokenizer option, just the default id and descrption.

In the past, oneOf was supported at the root level, in a separate code branch, now that code branch was consolidated for all oneOf fields.

I tried in VS Code and I can still create routes.

I wouldn't expect less 😅