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

$ref in response results in z.void() #178

Open
ferenckv opened this issue Jul 6, 2023 · 5 comments
Open

$ref in response results in z.void() #178

ferenckv opened this issue Jul 6, 2023 · 5 comments

Comments

@ferenckv
Copy link

ferenckv commented Jul 6, 2023

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

@astahmer
Copy link
Owner

astahmer commented Jul 7, 2023

got it, feel free to send a PR ! 🙏

@terrierscript
Copy link

Is this released?
I got same issue on 1.10.2

@astahmer
Copy link
Owner

yes, was merged here #188

@ncheungg
Copy link

ncheungg commented Mar 11, 2024

Seems to be happening to me as well on v1.16.2, my openapi JSON looks like the following

...
"responses": {
  "200": {
    "description": "OK",
    "content": {
      "*/*": {
        "schema": {
          "$ref": "#/components/schemas/UserInfo"
        }
      }
    }
  }
}
...

is this a supported use case?

@astahmer
Copy link
Owner

it looks like it should be fine, feel free to send a PR to fix it 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants