acacode / acacode/swagger-typescript-api

Request body not marked as optional by default

Ouverte
#897 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
TypeScript
Étoiles
4.1k
Forks
436
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.