Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-750

JSON response for non matching endtag with header containing accept application/xml

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • restconf
    • None
    • Operating System: Windows
      Platform: PC

    • 1659

    Description

      When making the request below a JSON response was received when a XML format was expected.

      Adding a flow with a non matching end tag.

      'method': 'POST',
      'uri': '/config/opendaylight-inventory:nodes/node/foo:node:18/table/18',
      'headers':

      {'content-type': 'application/xml','accept':'application/xml'}

      ,
      'data': '''<flow xmlns="urn:opendaylight:flow:inventory">
      <id>18</id>
      <instructions>
      <instruction>
      <order>0</order>
      </instruction>
      </flow>''',
      'expected_status': 400,
      'expected': '''<errors xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf"><error><error-type>protocol</error-type><error-tag>malformed-message</error-tag><error-message>Error parsing input: ParseError at [row,col]:[7,3] Message: The element type "instructions" must be terminated by the matching end-tag "</instructions>".</error-message></error></errors>'''

      RECEIVED

      {'errors': {'error':

      {'error-type': 'protocol', 'error-tag': 'malformed-message', 'error-message': 'error parsing input: parseerror at [row,col]:[7,3]\nmessage: the element type "instructions" must be terminated by the matching end-tag "</instructions>".'}

      }}

      TEST ENV

      org.opendaylight.controller.version = 0.1
      org.opendaylight.controller.build.scm.version = 78fec1c1c5a3720bd48d1044703824626f08b5d9
      org.opendaylight.controller.build.user = jenkins-controller
      org.opendaylight.controller.build.workspace = **********
      org.opendaylight.controller.build.timestamp = 1409283738738
      org.opendaylight.controller.build.machine = **********
      ~

      STEPS
      Used the cisco-sp artifact athttp://sn-bldsg.cisco.com/jenkins/job/ODL-CISCO-SP/1649/ no special configuration needed. I will repeat the test with the ODL SP edition.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jgloncak Jozef Gloncak
            ricjhill@gmail.com RichardHill
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: