@ng-openapi/http-resource 0.0.34-pr-85-testing-fd2f80a.0 → 0.0.34-pr-103-refactored-530435d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -9
- package/index.cjs +1245 -1292
- package/index.d.ts +157 -29
- package/index.js +1245 -1292
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,11 +22,8 @@
|
|
|
22
22
|
|
|
23
23
|
## What is HTTP Resource Plugin?
|
|
24
24
|
|
|
25
|
-
The HTTP Resource plugin generates Angular services using the
|
|
26
|
-
|
|
27
|
-
endpoints.
|
|
28
|
-
|
|
29
|
-
> ⚠️ **Experimental Feature**: `httpResource` is still experimental in Angular. Use with caution in production.
|
|
25
|
+
The HTTP Resource plugin generates Angular services using the `httpResource` API instead of traditional `HttpClient`.
|
|
26
|
+
This provides automatic caching, state management, and reactive data loading for your OpenAPI endpoints.
|
|
30
27
|
|
|
31
28
|
## Installation
|
|
32
29
|
|
|
@@ -46,8 +43,12 @@ import { HttpResourcePlugin } from "@ng-openapi/http-resource";
|
|
|
46
43
|
export default {
|
|
47
44
|
input: "./swagger.json",
|
|
48
45
|
output: "./src/api",
|
|
49
|
-
clientName: "
|
|
46
|
+
clientName: "MyApi",
|
|
50
47
|
plugins: [HttpResourcePlugin],
|
|
48
|
+
options: {
|
|
49
|
+
dateType: "Date",
|
|
50
|
+
enumStyle: "enum",
|
|
51
|
+
},
|
|
51
52
|
} as GeneratorConfig;
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -62,11 +63,12 @@ ng-openapi -c openapi.config.ts
|
|
|
62
63
|
```typescript
|
|
63
64
|
// app.config.ts
|
|
64
65
|
import { ApplicationConfig } from "@angular/core";
|
|
65
|
-
import {
|
|
66
|
+
import { provideMyApiClient } from "./api/providers";
|
|
66
67
|
|
|
67
68
|
export const appConfig: ApplicationConfig = {
|
|
68
69
|
providers: [
|
|
69
|
-
|
|
70
|
+
// The provider function is named after `clientName` ("MyApi" → provideMyApiClient)
|
|
71
|
+
provideMyApiClient({
|
|
70
72
|
basePath: "https://api.example.com",
|
|
71
73
|
}),
|
|
72
74
|
],
|
|
@@ -118,6 +120,6 @@ src/api/
|
|
|
118
120
|
|
|
119
121
|
## Documentation
|
|
120
122
|
|
|
121
|
-
- 📖 [Full Documentation](https://ng-openapi.dev/
|
|
123
|
+
- 📖 [Full Documentation](https://ng-openapi.dev/guide/http-resource)
|
|
122
124
|
- 🎯 [Angular httpResource Guide](https://angular.dev/guide/http/resource)
|
|
123
125
|
- 🚀 [Live Examples](https://stackblitz.com/@Mr-Jami/collections/ng-openapi-examples)
|