Skip to content

Commit dbb9e2e

Browse files
authored
Merge pull request #3006 from hey-api/refactor/dsl-type-nodes-12
refactor: angular plugin use dsl
2 parents 40cc96c + fc04654 commit dbb9e2e

File tree

20 files changed

+2359
-3232
lines changed

20 files changed

+2359
-3232
lines changed

dev/openapi-ts.config.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,32 @@ export default defineConfig(() => {
3333
// openapi: '3.1.0',
3434
// paths: {},
3535
// },
36-
path: path.resolve(
37-
getSpecsPath(),
38-
// '3.0.x',
39-
'3.1.x',
40-
// 'circular.yaml',
41-
// 'dutchie.json',
42-
// 'invalid',
43-
'full.yaml',
44-
// 'object-property-names.yaml',
45-
// 'openai.yaml',
46-
// 'opencode.yaml',
47-
// 'pagination-ref.yaml',
48-
// 'sdk-instance.yaml',
49-
// 'string-with-format.yaml',
50-
// 'transformers.json',
51-
// 'type-format.yaml',
52-
// 'validators.yaml',
53-
// 'validators-circular-ref.json',
54-
// 'validators-circular-ref-2.yaml',
55-
// 'zoom-video-sdk.json',
56-
),
36+
// path: path.resolve(
37+
// getSpecsPath(),
38+
// // '3.0.x',
39+
// '3.1.x',
40+
// // 'circular.yaml',
41+
// // 'dutchie.json',
42+
// // 'invalid',
43+
// 'full.yaml',
44+
// // 'object-property-names.yaml',
45+
// // 'openai.yaml',
46+
// // 'opencode.yaml',
47+
// // 'pagination-ref.yaml',
48+
// // 'sdk-instance.yaml',
49+
// // 'string-with-format.yaml',
50+
// // 'transformers.json',
51+
// // 'type-format.yaml',
52+
// // 'validators.yaml',
53+
// // 'validators-circular-ref.json',
54+
// // 'validators-circular-ref-2.yaml',
55+
// // 'zoom-video-sdk.json',
56+
// ),
5757
// path: 'https://get.heyapi.dev/hey-api/backend?branch=main&version=1.0.0',
5858
// path: 'http://localhost:4000/',
5959
// path: 'http://localhost:8000/openapi.json',
6060
// path: 'https://mongodb-mms-prod-build-server.s3.amazonaws.com/openapi/2caffd88277a4e27c95dcefc7e3b6a63a3b03297-v2-2023-11-15.json',
61-
// path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml',
61+
path: 'https://raw.githubusercontent.com/swagger-api/swagger-petstore/master/src/main/resources/openapi.yaml',
6262
// watch: {
6363
// enabled: true,
6464
// interval: 500,
@@ -217,11 +217,11 @@ export default defineConfig(() => {
217217
{
218218
// baseUrl: false,
219219
// exportFromIndex: true,
220-
name: '@hey-api/client-fetch',
220+
name: '@hey-api/client-angular',
221221
// runtimeConfigPath: path.resolve(__dirname, 'hey-api.ts'),
222222
// runtimeConfigPath: './src/hey-api.ts',
223223
// strictBaseUrl: true,
224-
// throwOnError: true,
224+
throwOnError: true,
225225
},
226226
{
227227
// case: 'snake_case',
@@ -255,7 +255,7 @@ export default defineConfig(() => {
255255
// classNameBuilder: '{{name}}',
256256
// classNameBuilder: '{{name}}Service',
257257
// classStructure: 'off',
258-
client: false,
258+
// client: false,
259259
// getSignature: ({ fields, signature, operation }) => {
260260
// // ...
261261
// fields.unwrap('path')
@@ -265,7 +265,7 @@ export default defineConfig(() => {
265265
name: '@hey-api/sdk',
266266
// operationId: false,
267267
// paramsStructure: 'flat',
268-
// responseStyle: 'data',
268+
responseStyle: 'data',
269269
// signature: 'auto',
270270
// signature: 'client',
271271
// signature: 'object',
@@ -517,12 +517,12 @@ export default defineConfig(() => {
517517
{
518518
exportFromIndex: true,
519519
httpRequests: {
520-
// asClass: true,
520+
asClass: true,
521521
},
522522
httpResources: {
523-
// asClass: true,
523+
asClass: true,
524524
},
525-
// name: '@angular/common',
525+
name: '@angular/common',
526526
},
527527
{
528528
exportFromIndex: true,

examples/openapi-ts-angular-common/src/client/@angular/common.gen.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,7 @@ export const updateUserRequest = <ThrowOnError extends boolean = false>(
328328
...options,
329329
});
330330

331-
@Injectable({
332-
providedIn: 'root',
333-
})
331+
@Injectable({ providedIn: 'root' })
334332
export class PetServiceResources {
335333
/**
336334
* Add a new pet to the store.
@@ -445,9 +443,7 @@ export class PetServiceResources {
445443
}
446444
}
447445

448-
@Injectable({
449-
providedIn: 'root',
450-
})
446+
@Injectable({ providedIn: 'root' })
451447
export class StoreServiceResources {
452448
/**
453449
* Returns pet inventories by status.
@@ -506,9 +502,7 @@ export class StoreServiceResources {
506502
}
507503
}
508504

509-
@Injectable({
510-
providedIn: 'root',
511-
})
505+
@Injectable({ providedIn: 'root' })
512506
export class UserServiceResources {
513507
/**
514508
* Create user.

0 commit comments

Comments
 (0)