acacode / acacode/swagger-typescript-api

No result from methods that do not have an explicit content type

Abierto
#527 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
4.1k
Forks
436
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

When generating an api from a spec that does not define the content, the generated code does not return anything.

IMO, since a result type is defined it should return a result.

e.g. from https://github.com/gothinkster/realworld/blob/main/api/openapi.yml

```
responses:
'200':
$ref: '#/components/responses/MultipleArticlesResponse'
```

will generate

```
this.request({
path: `/articles`,
method: "GET",
query: query,
...params,
}),
```

The problem is that this method will not return anything.

If I manually change the spec:

```
'200':
content:
application/json:
$ref: '#/components/responses/MultipleArticlesResponse'
```

I get the correct result with:

```
this.request({
path: `/articles`,
method: "GET",
query: query,
format: "json",
...params,
}),
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.