这是indexloc提供的服务,不要输入任何密码
Skip to content

experimentalParser does not handle unknown schema #1334

@memben

Description

@memben

Description

Hey thanks for the amazing work - I absolutely love this project,

I just saw that the zod schema generation has been dropped - really excited about that! Trying it out for our project already seemed great :) - However, while building the new client, I noticed that types.gen.ts seems to be missing unknown schemas:

Without the experimental parser it generates export type HealthcheckResponse = (unknown);. With the experimental parser, this export is removed, leading to failed imports in services.gen.ts.

Reproducible example or configuration

import { defineConfig } from "@hey-api/openapi-ts";

export default defineConfig({
  client: "@hey-api/client-axios",
  experimentalParser: true,
  input: "http://localhost:8000/openapi.json",
  output: "src/client",
  plugins: [
    "@tanstack/react-query",
    "zod",
    {
      dates: true,
      name: "@hey-api/transformers",
    },
  ],
});

npx openapi-ts with "@hey-api/openapi-ts": "^0.57.0",

OpenAPI specification (optional)

"/healthcheck": {
      "get": {
        "tags": [
          "Monitoring"
        ],
        "summary": "Healthcheck",
        "operationId": "healthcheck",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                }
              }
            }
          }
        }
      }
    },

System information (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't workingprioritized 🚚This issue has been prioritized and will be worked on soon

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions