-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
MIME types / example externalValues not respected #115
Comments
The issue is that a schema in The schema section is designed to give a representation of the JSON schema, hence I'm not totally sure of the best way to accommodate this. Possibly we could take the rendered example and see if it parses as JSON, and use that to set the syntax-highlighting language? The OAS proposal for |
Ah, that makes perfect sense. I am pretty new to OpenAPI, so I misunderstood some things about schemas. After reading up I get it. I changed to an example being loaded from an external CSV file, but I'm getting 1 more issue. After generating, it's putting in weird characters that I'm not expecting. responses:
'200':
description: 'CSV Data.'
content:
text/csv:
schema:
type: string
example:
$ref: './examples/csvdata.csv' generates:
Any idea why it's inserting:
After resolving this I think we'll be in good shape! |
This was still using a fork that I was hacking on (npm module didn't update), so this is my bug, not yours. I'll put in a PR once I get it all sorted, with CSV and plaintext support. |
So, I'm kind of stuck at this point. I added some logic for handling See here for swagger2openapi: And here for Widdershins: My changed YAML is: responses:
'200':
description: 'CSV Data'
content:
text/csv:
examples:
csv:
externalValue: 'examples/csvdata.csv' The problem I'm running into is:
We should probably abandon this issue at this point and move the into a feature request. Hopefully you can take a look at this and see what's going on. I'm happy to clean this up and get it ready for a pull request (remove IntelliJ generated files, etc.) if you think it's a good approach. |
|
@LukeL99 The mono-repo reorganisation has been completed now, so if you're still interested in raising a PR to (optionally) support pulling in As this issue has touched on various things over its life, I'm going to close it as you suggested, and feel free to raise a new feature-request and/or PRs. Thanks in advance. |
I'm having an issue where all of my responses are marked up as JSON, no matter what the MIME type that I use is set as. For example, this:
Outputs markup with a JSON header:
I think proper behavior would be to add code highlighting hints if it's JSON or XML (or any other common interchange formats that have highlighting), but to leave the highlighting hint off if it is unknown.
The text was updated successfully, but these errors were encountered: