astahmer / openapi-zod-client

Generate a zodios (typescript http client with zod validation) from an OpenAPI spec (json/yaml)

Home Page:openapi-zod-client.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

$ref in response results in z.void()

ferenckv opened this issue · comments

Using this operation

post:
  summary: Dummy post
  description: Dummy post
  tags:
    - dummy
  security:
    - bearerAuth: []
  requestBody:
    required: true
    content:
      application/json:
        schema:
          type: object
          properties:
            dummyProperty:
              $ref: "../schemas/DummyProperty.yaml"
          required:
            - dummyProperty
  responses:
    "200":
      $ref: "../responses/GenericSuccess.yaml"
    default:
      $ref: "../responses/UnexpectedError.yaml"

Generates the response as z.void().

This happens because this method does not consider that responseItem can contain a $ref

got it, feel free to send a PR ! 🙏

Is this released?
I got same issue on 1.10.2

yes, was merged here #188