swagger-api / swagger-api/swagger-parser

Wrong error is given when opening an invalid OpenAPI YAML

Open
#891 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

Opening an invalid OpenAPI 3 YAML produces Wrong specification url/path: .. error message.

Issue appears to be with the general handling of any error with in the io.swagger.v3.parser.OpenAPIV3Parser#readWithInfo(java.lang.String, java.util.List<io.swagger.v3.parser.core.models.AuthorizationValue>) method. There should be a try/catch around the Object mapper to handle parse exceptions and provide a better error to the console.

See: https://github.com/vert-x3/vertx-web/issues/1004

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in io.swagger.v3.parser.OpenAPIV3Parser#readWithInfo(java.lang.String, java.util.List<io.swagger.v3.parser.core.models.AuthorizationValue>) and reproduce the invalid OpenAPI 3 YAML case. Inspect how the Object mapper handles parse exceptions. Done means the console reports the YAML parsing problem instead of “Wrong specification url/path: ..”.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.