Skip to content

Commit 549a42e

Browse files
authored
Merge pull request #3678 from hey-api/copilot/fix-angular-common-http-config
fix(@angular/common): httpRequests and httpResources disabled by default since v0.90
2 parents dfbd9a1 + 7ad5a2c commit 549a42e

File tree

6 files changed

+1628
-4
lines changed

6 files changed

+1628
-4
lines changed

.changeset/pink-rivers-sniff.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+
**plugin(@angular/common)**: fix: requests and resources broken default configuration

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

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 595 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 595 additions & 0 deletions
Large diffs are not rendered by default.

packages/openapi-ts/src/plugins/@angular/common/httpRequests/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ export function resolveHttpRequests(config: Config, context: PluginContext): Htt
99
let input = config.httpRequests;
1010
if (typeof input === 'string' || typeof input === 'function') {
1111
input = { strategy: input };
12-
} else if (typeof input === 'boolean' || !input) {
13-
input = { enabled: Boolean(input) };
12+
} else if (typeof input === 'boolean') {
13+
input = { enabled: input };
14+
} else if (!input) {
15+
input = {};
1416
}
1517

1618
const strategy = input.strategy ?? 'flat';

packages/openapi-ts/src/plugins/@angular/common/httpResources/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ export function resolveHttpResources(config: Config, context: PluginContext): Ht
99
let input = config.httpResources;
1010
if (typeof input === 'string' || typeof input === 'function') {
1111
input = { strategy: input };
12-
} else if (typeof input === 'boolean' || !input) {
13-
input = { enabled: Boolean(input) };
12+
} else if (typeof input === 'boolean') {
13+
input = { enabled: input };
14+
} else if (!input) {
15+
input = {};
1416
}
1517

1618
const strategy = input.strategy ?? 'flat';

0 commit comments

Comments
 (0)