Skip to content

Commit f14f95a

Browse files
authored
Merge pull request #2850 from hey-api/copilot/fix-writeonly-regression
Fix writeOnly regression: response types incorrectly use writable variants
2 parents 3fc7caa + 16cc0e7 commit f14f95a

File tree

145 files changed

+3249
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+3249
-141
lines changed

.changeset/mighty-adults-wave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hey-api/openapi-ts": patch
3+
---
4+
5+
fix(parser): write-only schema incorrectly used in response schemas

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default-class/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@angular/common/default/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/schemas/default/schemas.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,16 @@ export const external_shared_ExternalSharedModelSchema = {
693693
required: ['id']
694694
} as const;
695695

696+
export const ModelWithReferenceWritableSchema = {
697+
description: 'This is a model with one property containing a reference',
698+
type: 'object',
699+
properties: {
700+
prop: {
701+
'$ref': '#/definitions/ModelWithPropertiesWritable'
702+
}
703+
}
704+
} as const;
705+
696706
export const ModelWithPropertiesWritableSchema = {
697707
description: 'This is a model with one nested property',
698708
type: 'object',

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@pinia/colada/fetch/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/fetch/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/types.gen.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ export type ExternalSharedExternalSharedModel = {
419419
name?: string;
420420
};
421421

422+
/**
423+
* This is a model with one property containing a reference
424+
*/
425+
export type ModelWithReferenceWritable = {
426+
prop?: ModelWithPropertiesWritable;
427+
};
428+
422429
/**
423430
* This is a model with one nested property
424431
*/

0 commit comments

Comments
 (0)