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

Array of arrays of object not showing inputs #1317

Open
mariusrak opened this issue Apr 13, 2024 · 0 comments
Open

Array of arrays of object not showing inputs #1317

mariusrak opened this issue Apr 13, 2024 · 0 comments
Assignees

Comments

@mariusrak
Copy link
Contributor

mariusrak commented Apr 13, 2024

Hi, this schema produces no inputs:

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": [
                        new SimpleSchema({
                                question: String,
                                answer: String,
                        }),
                ],
        }),
})

Just put it in the playground and try. Doesn't work even with simple objects

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": Array,
                "items.$.$": Object,
                "items.$.question": String,
                "items.$.answer": String,
        }),
})

Or even with just string nested twice

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": Array,
                "items.$.$": Object,
                "items.$.$.question": String,
        }),
})

When nesting is broken down by object it works:

new SimpleSchema2Bridge({
        schema: new SimpleSchema({
                items: Array,
                "items.$": Object,
                "items.$.content": [
                        new SimpleSchema({
                                question: String,
                                answer: String,
                        }),
                ],
        }),
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants