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

Issue with index on nested array #876

Closed
GeekEdem opened this issue Dec 24, 2018 · 1 comment
Closed

Issue with index on nested array #876

GeekEdem opened this issue Dec 24, 2018 · 1 comment

Comments

@GeekEdem
Copy link

GeekEdem commented Dec 24, 2018

Hello. Some issue with index on nested array.

Schema:

{
  title: "requests schema",
  version: 0,
  type: "object",
  properties: {
    requests: {
      type: "array",
      item: {
        properties: {
          id: {
            type: "string",
            regex: /[a-f0-9]{24}/i,
            index: true,
          },
          requestType: {
            type: "string",
          },
        },
      },
    },
  },
  required: ["requests"],
}

Check #697 :
const schemaObj = objectPath.get(jsonID, 'properties.' + key.replace(/\./g, '.properties.'));

schemaObj become like requests.properties.item.properties.id but must be requests.[].id.

@pubkey
Copy link
Owner

pubkey commented Dec 25, 2018

I think you forgot the type inside of item:
But still looks like a valid bug. Could you PR a test to reproduce the problem?

@pubkey pubkey closed this as completed Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants