Skip to content

Cannot nest an array of string #2

@nimai

Description

@nimai

Hello,

Thank you for this nice library, it's quite useful.
I'm facing an issue right now with the formatting of a nested array of strings. It's probably just a missing feature, but I really expected it to work. Maybe I'm doing something wrong?

This gives me an error:

await n.array(
            n.type({
                customerId: n.string('po.dis_code'),
                orderNumber: n.string('po.orderingporef', {id: true}),
                orderLines: n.array(
                    n.type({
                        lineId: n.string('pol.orderingreference', {id: true}),
                        price: n.number('po.unitprice'),
                        activationNumber: **n.array(n.string('s.code'))**
                    })
                )
            })
        ).withQuery(q)

Error: invalid structPropToColumnMap format - property 'id' must be either a string, a plain object or an array

and this doesn't:

await n.array(
            n.type({
                customerId: n.string('po.dis_code'),
                orderNumber: n.string('po.orderingporef', {id: true}),
                orderLines: n.array(
                    n.type({
                        lineId: n.string('pol.orderingreference', {id: true}),
                        price: n.number('po.unitprice'),
                        activationNumber: **n.array(n.type({a: n.string('s.code')}))**
                    })
                )
            })
        ).withQuery(q)

Anyway, it would be nice to be able to nest arrays of strings.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions