davsclaus opened a new pull request, #28115:
URL: https://github.com/apache/camel/pull/28115

   [CAMEL-25820](https://issues.apache.org/jira/browse/CAMEL-25820), the part 
in camel-yaml-dsl-validator. #28113 is the camel-jbang part.
   
   Each JVM that validated a Kamelet logged this warning once, such as each 
`camel` command and each MCP server:
   
   ```
   WARN com.networknt.schema.keyword.UnknownKeywordFactory : Unknown keyword 
templateEntry - you should define your own Meta Schema. If the keyword is 
irrelevant for validation, just use a NonValidationKeyword or if it should 
generate annotations AnnotationKeyword
   ```
   
   `YamlValidator` builds the schema of a Kamelet from the route schema 
(CAMEL-25194). It kept the schema of the template under a key of its own at the 
root (`templateEntry`), which is not a JSON schema keyword. The validator 
(networknt 3.0.4) warns about an unknown keyword once per JVM.
   
   ## What
   
   - The schema of the template is kept under `definitions`, and 
`spec.template` refers to `#/definitions/templateEntry`.
   - `definitions` is where draft 4 keeps a schema that is only referenced. The 
route schema is draft 4, so `$defs` (draft 2019-09) would be an unknown keyword 
too.
   - The validation is the same.
   
   ## Tests
   
   - `KameletValidationTest` (1 more): validating a Kamelet logs no warning 
about an unknown keyword. The validator warns once per JVM, so a test that 
loaded the schema before would hide the warning. The test therefore also checks 
that the schema has only keywords at its root.
     - Without the fix, it fails with the warning above.
   - All tests of camel-yaml-dsl-validator pass (263), and the Kamelet tests of 
camel-jbang-core (58), whose test log no longer has the warning.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to