Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fixes for XML render #2766

Merged
merged 1 commit into from
Mar 23, 2017
Merged

fixes for XML render #2766

merged 1 commit into from
Mar 23, 2017

Conversation

bodnia
Copy link
Contributor

@bodnia bodnia commented Mar 22, 2017

swagger: "2.0"
info:
  version: "1.0"
  title: test

consumes:
  - application/json
  - application/xml
produces:
  - application/json
  - application/xml

paths:
  /:
    post:
      parameters:
        - in: body
          name: body
          schema:
            $ref: '#/definitions/ObjectWithArrayProperty'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ObjectWithArrayProperty'

definitions:
  ObjectWithArrayProperty:
    type: object
    required: [arr]
    properties:
      arr:
        type: array
        items:
          type: string
        example:
          - item1
          - item2
        #xml:
        #  wrapped: true

Actual result: XML example looks like:

<?xml version="1.0" encoding="UTF-8"?>
<ObjectWithArrayProperty>
	<arr>string</arr>
</ObjectWithArrayProperty>

Expected result: XML example should looks like:

<?xml version="1.0" encoding="UTF-8"?>
<ObjectWithArrayProperty>
	<arr>item1</arr>
	<arr>item2</arr>
</ObjectWithArrayProperty>

@bodnia bodnia merged commit 204ea46 into swagger-api:master Mar 23, 2017
@bodnia bodnia deleted the fixes-xml branch March 23, 2017 17:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant