Skip to content

Top level arrays incorrectly typed #252

@morley92

Description

@morley92

The below issue has recurred with the latest versions of the @anatine packages alongside NestJS 11.

#215

Here's a copy/paste from the original issue -

For createZodDto() usage such as:

const contactGroupsSchema = z.object({
  contactGroups: z.string().array().optional().describe('Filter by Xero Contact Groups'),
});
class ContactGroupsDto extends createZodDto(contactGroupsSchema) {}

produces

{
  "name": "contactGroups",
  "required": false,
  "in": "query",
  "description": "Filter by Xero Contact Groups",
  "schema": {
    "type": "array"
  }
}

rather than

{
  "name": "contactGroups",
  "required": false,
  "in": "query",
  "description": "Filter by Xero Contact Groups",
  "schema": {
    "type": "array",
    "items": {
      "type": "string"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions