acacode / acacode/swagger-typescript-api

Can This Tool Generate a Single Angular File with Custom `HttpResponse` Types and No Additional Files?

Open
#1,001 0 comments 1 reaction 0 assignees View on GitHub
enhancement question
Dominant language
TypeScript
Stars
4.1k
Forks
436
PR merge metrics
No merged PRs in 30d

Description

Before I try this tool (it looks great!), I want to confirm: is it possible to generate a single file, like `users.service.ts` in Angular, with the following structure?

```typescript
@Injectable({ providedIn: 'root' })
export class UserApiService {
#http = inject(HttpClient);

getUsers() {
return this.#http.get(`/api/v1/users`);
}

user(id: number): Observable> {
return this.#http.post(`/api/v1/users/search`, { id }, { observe: 'response' });
}
}
```

Specifically:
1. Can I generate the `HttpResponse` type based on matching specific URLs I provide in a list?
2. Can the tool avoid generating additional files, keeping everything (like interfaces) in the same file?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.