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

fix: do not export common properties as schemas #424

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tall-snakes-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hey-api/openapi-ts": patch
---

fix: do not export common properties as schemas
6 changes: 0 additions & 6 deletions packages/openapi-ts/src/utils/write/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ export const processSchemas = async ({ file, openApi }: { file?: TypeScriptFile;
addSchema(name, schema);
}
}
for (const name in openApi.components.parameters) {
if (openApi.components.parameters.hasOwnProperty(name)) {
const parameter = openApi.components.parameters[name];
addSchema(name, parameter);
}
}
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -1640,23 +1640,3 @@ export const $ModelWithNumericEnumUnion = {
},
},
} as const;

export const $SimpleParameter = {
description: 'This is a reusable parameter',
name: 'parameter',
in: 'query',
required: false,
schema: {
type: 'string',
},
} as const;

export const $x_Foo_Bar = {
description: 'Parameter with illegal characters',
name: 'x-Foo-Bar',
in: 'header',
required: true,
schema: {
type: 'string',
},
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

export { ApiError } from './core/ApiError';
export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI';
export * from './schemas.gen';
export * from './services.gen';
export * from './types.gen';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// This file is auto-generated by @hey-api/openapi-ts

export * from './schemas.gen';
export * from './types.gen';
Loading