-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I have endpoint, that returns array of Guids. Instead of correct mapping generaton in service method, i got wrong generation.
To Reproduce
"/api/v1/attachment/image/list/{id}": {
"get": {
"tags": [
"image"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
}
}
}
}
}
}Expected behavior
generation like that:
public list(id: string): Observable<Guid[]> {
return this.get<string[]>(
`list/${encodeURIComponent(id)}`,
).pipe(map((arr: string[]) => arr.map(z => (z ? new Guid(z) : Guid.empty)) ));
}Additional context
In fact generated this code
public list(id: string): Observable<Guid[]> {
return this.get<string[]>(
`list/${encodeURIComponent(id)}`,
).pipe(map(x => mapGuid()));
}
with error:
TS2322: Type Observable<OperatorFunction<string, Guid>> is not assignable to type Observable<Guid[]>
Type OperatorFunction<string, Guid> is not assignable to type Guid[]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working