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 samples in response when there is no schema in response #307

Closed
jenniferwang2000 opened this issue Jul 21, 2017 · 1 comment
Assignees

Comments

@jenniferwang2000
Copy link

jenniferwang2000 commented Jul 21, 2017

Now ReDoc supports xml sample in response when there is schema in response. Can we support to display xml sample in response when there is no schema in response?

My sample file:

    '200':
      description: |
        json sample without schema
      examples: 
        application/json:
          {
            "field1": "value1",
            "field2": "value2"
          }
    '400':
      description: |
        XML sample without schema
      examples: 
        application/xml:              
            <field>
              <name>TaxMode</name>
              <label>Tax Mode</label>
              <type>picklist</type>
              <options>
                <option>TaxExclusive</option>
                <option>TaxInclusive</option>
              </options>
              <contexts>
                <context>export</context>
              </contexts>
            </field>              
    '500':
      description: |
        XML sample with schema
      schema:
        $ref: '#/definitions/sampleSchema'          
      examples: 
        application/xml:              
            <field>
              <name>TaxMode</name>
              <label>Tax Mode</label>
              <type>picklist</type>
              <options>
                <option>TaxExclusive</option>
                <option>TaxInclusive</option>
              </options>
              <contexts>
                <context>export</context>
              </contexts>
            </field>

"XML sample without schema" can't be displayed in ReDoc.

@RomanHotsiy
Copy link
Member

@jenniferwang2000 thanks for detailed issue report.
This seems to be easy-fixable.
Will try to include this fix in the upcoming release!

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

No branches or pull requests

2 participants