[ 
https://issues.apache.org/jira/browse/CAMEL-18829?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-18829:
--------------------------------
    Fix Version/s: 4.0

> camel-yaml-dsl - generate-yaml-schema - Support `additionalProperties: false`
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-18829
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18829
>             Project: Camel
>          Issue Type: Task
>          Components: camel-yaml-dsl
>            Reporter: Tomohisa Igarashi
>            Assignee: Tomohisa Igarashi
>            Priority: Major
>             Fix For: 3.21.0, 4.0
>
>
> JSON schema requires `additionalProperties: false` to be specified to 
> prohibit additional properties those are not explicitly defined in 
> `properties`
> https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties
> And it doesn't propagate to the children, i.e. `additionalProperties: false` 
> needs to be specified on each object definition.
> Since camel-yaml-dsl/generate-yaml-schema mojo doesn't add this property at 
> this moment, the generated schema doesn't really restrict properties. We want 
> to add an option 'additionalProperties" on generate-yaml-schema mojo, and if 
> it's false, add `additionalProperties: false` on each objects in generated 
> schema so that it declares explicit restriction. The option should be `true` 
> by default so that it doesn't add anything in order to preserve current 
> behavior.
> An example of having `additionalProperties` to be `false`
> https://github.com/igarashitm/example-generate-yaml-schema/blob/main/pom.xml#L71
> And generated YAML schema from it
> https://github.com/igarashitm/example-generate-yaml-schema/commit/85441fdcc6c641a2ef02aea7149a66a0429b3c92#diff-b1d8ab8b59f212acab62fab8cab033f98736c4bd9e92cc34fcf9b53457dbc1d0



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to