openapi-ts icon indicating copy to clipboard operation
openapi-ts copied to clipboard

schema not exported via cli

Open MR4online opened this issue 8 months ago • 1 comments

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 avatar May 14 '25 14:05 MR4online

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 =)

MR4online avatar May 14 '25 15:05 MR4online