acacode / acacode/swagger-typescript-api
Request returning null in data and error when no response type defined
- Vorherrschende Sprache
- TypeScript
- Sterne
- 4.1k
- Forks
- 436
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi,
I'm encountering an issue when defining a 2xx response code without response type defined. like:
```
...
responses:
200:
description: A successful response.
# schema:
# $ref: "#/definitions/performResponse"
default:
description: Generic error response.
schema:
$ref: "#/definitions/error"
```
When I generate the code like:
`npx swagger-typescript-api -p ./swagger.yml -o ./mypath -n myfile.ts`
The request is ALWAYS returning null for both "data" and "error". (see image(I added a console.log()))

If I define a response type (by uncomenting the lines there) then there is something in the "data" or "error" but not sure why and if this might be a bug.

Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.