-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support example for proper json MIME types #190
Comments
I'm open to suggestions as long everything else works as well as before. I also rather stick to "works as designed" as to partial solutions. If you manage to find a solid holistic solution, I'm up for it 👍 |
I agree solving it partially is not a solution - will try to propose a holistic solution |
Please take a look at the PR. I think I found a solution. |
* support for recognizing complex MIME definitions in OAS3 content type fixes #190 * MR comment fixes vol 1. * support of MIME for swagger v2.0
Currently only examples under
application/json
are supported.However a proper json payload can be indicated by e.g.
application/json;charset=utf-8
,application/vnd.some.model+json
.Both examples provided confirm to MIME grammar (https://en.wikipedia.org/wiki/Media_type).
I thought simple improvement of a pattern could help. Like:
$..responses..content[?(@property.match(/[\/+]json/))].example
.However, it works only partially due to the how jsonpath-plus parser works internally - in short it uses
;
as fragment separator.So I could identify all examples with improved json-path but then identification of elements would not work.
Switching to json pointers could be a way forward.
The text was updated successfully, but these errors were encountered: