Skip to content

Commit

Permalink
Merge pull request #424 from hey-api/fix/schemas-export
Browse files Browse the repository at this point in the history
fix: do not export common properties as schemas
  • Loading branch information
mrlubos authored Apr 18, 2024
2 parents b7b0859 + 901ed48 commit c22aabd
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 3,373 deletions.
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

0 comments on commit c22aabd

Please sign in to comment.