swagger-api/swagger-ui

Invalid POST JSON body fails silently

Open

#5 828 ouverte le 7 févr. 2020

Voir sur GitHub
 (5 commentaires) (14 réactions) (0 assignés)JavaScript (8 801 forks)batch import
Hacktoberfesttype: bug

Métriques du dépôt

Stars
 (25 447 stars)
Métriques de merge PR
 (Merge moyen 20h 34m) (14 PRs mergées en 30 j)

Description

Q&A (please complete the following information)

  • OS: Ubuntu 18
  • Browser: chrome
  • Version: 80.0.3987.87 (Official Build) (64-bit)
  • Method of installation: npm
  • Swagger-UI version: 3.25.0
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]

Describe the bug you're encountering

An invalid JSON body doesn't display an error message or state. If you enter invalid JSON and click execute, nothing seems to happen. This can be reproduced on this endpoint that accepts JSON.

To reproduce...

Steps to reproduce the behavior:

  1. Go to https://petstore.swagger.io/#/pet/addPet
  2. Click on try it out
  3. change the body to any invalid JSON string
  4. Attempt to execute the request

Expected behavior

An error message or some state change that makes it clear that the input is invalid.

Screenshots

Screenshot from 2020-02-07 14-48-06

Additional context or thoughts

I wasn't able to track down any open issues for this, but I did find an old one that may be related: https://github.com/swagger-api/swagger-ui/issues/5648

Guide contributeur