question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OpenAPIDeserializer produces message with location that omits the mediaType

See original GitHub issue

The OpenAPIDeserializer is generally good at indicating where an error was encountered. However, in the case below, it produces a message

attribute paths.'/myPath'(get).responses.200.content.bar is unexpected

It should instead read

attribute paths.'/myPath'(get).responses.200.content.'application/json'.bar is unexpected

How to reproduce:

  1. Store this file as input.yaml.

input.yaml.gz

  1. Store this file as ParseOpenAPI3File.java.

ParseOpenAPI3File.java.gz

Compile it with a classpath that contains slf4j-api-1.5.8.jar slf4j-jdk14-1.5.8.jar jackson-core-2.9.9.jar jackson-dataformat-yaml-2.9.9.jar jackson-databind-2.9.9.jar jackson-annotations-2.9.9.jar commons-io-1.4.jar commons-lang3-3.1.jar swagger-models-2.0.8.jar swagger-parser-v3-2.0.12.jar swagger-core-2.0.8.jar swagger-parser-core-2.0.12.jar snakeyaml.jar

  1. Run it with one argument, namely the absolute file name from step 1.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
brhaiblecommented, Dec 19, 2019

The following patch fixes it:

issue1274-fix.diff.gz

0reactions
gracekarinacommented, Jan 18, 2020

closed by #1295

Read more comments on GitHub >

github_iconTop Results From Across the Web

Media Types - Swagger
Each media type includes a schema , defining the data type of the message body, and, optionally, one or several examples. For more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found