Skip to content
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 for XML in response examples #81

Closed
luileito opened this issue Dec 12, 2016 · 1 comment
Closed

Support for XML in response examples #81

luileito opened this issue Dec 12, 2016 · 1 comment

Comments

@luileito
Copy link

I'd like to display both JSON and XML examples, like in this snippet:

  ...
  responses:
    200:
      examples:
        application/json:
          data: false
          code: 9001
        application/xml: |
          <root>
            <data>false</data>
            <code>9001</code>
          </root>

However, the output is parsed as a raw string:

"<root>\n  <data>false</data>\n  <code>9001</code>\n</root>\n"

This issue is somehow related to #37 (no XML is displayed) and #77 (newlines are not removed).

nknapp added a commit that referenced this issue Dec 13, 2016
Closes #81
Closes #77

- Examples may be provided as string and need not be a JSON object
  see https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/yaml/api-with-examples.yaml
- in such a case, we don't want to JSON.stringify the example but display it as is.
nknapp added a commit that referenced this issue Dec 17, 2016
…#82)

Closes #81
Closes #77

- Examples may be provided as string and need not be a JSON object
  see https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/yaml/api-with-examples.yaml
- in such a case, we don't want to JSON.stringify() the example but display it as is.
@nknapp
Copy link
Member

nknapp commented Dec 17, 2016

This has now landed in bootprint-openapi@0.17.1 Which I published today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants