You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by "Romain Manni-Bucau (Jira)" <ji...@apache.org> on 2021/12/15 19:57:00 UTC
[jira] [Commented] (JOHNZON-356) patternProeprties for nested properties
[ https://issues.apache.org/jira/browse/JOHNZON-356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17460218#comment-17460218 ]
Romain Manni-Bucau commented on JOHNZON-356:
--------------------------------------------
Hi [~radu.almasan] , you can fork the project on github and send a pull request. Patch looks ok to me but it is better to use github if possible for reviews.
> patternProeprties for nested properties
> ---------------------------------------
>
> Key: JOHNZON-356
> URL: https://issues.apache.org/jira/browse/JOHNZON-356
> Project: Johnzon
> Issue Type: Improvement
> Reporter: Radu Almășan
> Priority: Major
> Labels: patch
> Attachments: 0001-fix-using-patternProperties-in-nested-objects.patch
>
>
> When using {{patternProperties}} on nested properties it apparently gets ignored. For example for the following schema:
> {code:java}
> {
> "type": "object",
> "properties": {
> "nested": {
> "type": "object",
> "patternProperties": {
> "[0-9]+": {
> "type": "number"
> }
> }
> }
> }
> }{code}
> This JSON would appear valid:
> {code:java}
> {
> "nested": {
> "1": "foo"
> }
> } {code}
> I believe this is because the code isn't using the {{valueProvider}} to resolve the actual validable but is always defaulting to the root object.
> I do not have access to push a branch and create a PR so I'm attaching the git patch to this issues with the proposed fix and test.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)