Skip to content

schema not exported via cli #2042

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

Open
MR4online opened this issue May 14, 2025 · 1 comment
Open

schema not exported via cli #2042

MR4online opened this issue May 14, 2025 · 1 comment
Labels
bug 🔥 Something isn't working

Comments

@MR4online
Copy link

MR4online commented May 14, 2025

Description

Hi there.

I do have a simple openapi.yaml with one Route "getAddress" and one Schema "Address".
I want to export the SDK as class, so i created a config file (see below).

When I run the following command, types are generated with "Address" schema, but sdk is no class (i, o and c options are in the config file as well):

npx @hey-api/openapi-ts \
  -f "FOLDER/openapi-ts.config.ts" \
  -i "FOLDER/openapi.json"  \
  -o "FOLDER/generated" \
  -c @hey-api/client-fetch

but when I reduce the command to the neccessary properties (everything else is in the config file), the "Address" schema is missing in the types.gen.ts, but sdk is exported as class

npx @hey-api/openapi-ts \
  -f "FOLDER/openapi-ts.config.ts"

Am I missing something in the openapi-ts.config.ts file to generate the schema?

Thanks a lot!
kind regards =)

Reproducible example or configuration

import { defaultPlugins } from '@hey-api/openapi-ts';

export default {
    input: '../../FOLDER/openapi.yaml',
    output: './generated',
    plugins: [
        ...defaultPlugins,
        '@hey-api/client-fetch',
        {
            asClass: true,
            name: '@hey-api/sdk',
        }
    ],
};

OpenAPI specification (optional)

No response

System information (optional)

"@hey-api/openapi-ts": "^0.67.3"

@MR4online MR4online added the bug 🔥 Something isn't working label May 14, 2025
@MR4online
Copy link
Author

MR4online commented May 14, 2025

if I correctly understand the debug logs, the config-file (when adding with -f ) is acknowledged, but ignored.
However: when I just exec
npx @hey-api/openapi-ts -d
the config file is found and used (sdk exported as class), but the "Address" Schema is still missing.

Any help? Please =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant