acacode / acacode/swagger-typescript-api

Request body not marked as optional by default

Aberta
#897 0 comentários 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
TypeScript
Estrelas
4.1k
Forks
436
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

According to the [swagger specification](https://swagger.io/docs/specification/describing-request-body/), request bodies are optional by default, i.e. if the `required` field doesn't exist, it should be inferred as `false`.

From my limited knowledge of the code, this seems to be doing the opposite, causing any `requestBody` without the `required` parameter to be inferred as required, even though it should not be.

https://github.com/acacode/swagger-typescript-api/blob/4d48d20626407fe91bf03671260ba520ba4889a6/src/schema-routes/schema-routes.js#L626-L628

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.