Skip to content

[zod-nestjs][zod-openapi] use $ref instead of properties for items #108

Open
@nidomiro

Description

@nidomiro

I want to ditch classvalidator for zod in nestjs. Unfortunately my company is strict about the format of the OpenApi-Document.
What my company expects:

components:
  schemas:
    MyListResponse:
        myList:
          items:
            $ref: '#/components/schemas/ItemType'

what currently is generated:

components:
  schemas:
    MyListResponse:
        myList:
          items:
            properties:
              prop1:
                description: Desc. of prop1
                format: decimal
                type: number

how is it possible to get the first version when generating the document?

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