Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Automatically parse content-types ending with +xml or +json with the correct parser #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Rest-assured is working well for us, but it would be nice if it had
specific support for media-types/content-types with the "+xml"
extension. To be precise, rather than throwing up it's hands and
saying "I don't support this content type, please add using
RestAssured.registerParser" when receiving a message with an unknown
content type, it should be able to default to treating it as XML if
the last four characters of the content-type header value are
"+xml"  (as per rfc3023).

This would save us registering the many different media types we use
in our application, as they all end in '+xml'.

The option to automatically treat +xml and +json as XML or JSON could also be 
configurable in the detailed configuration.

Original issue reported on code.google.com by johan.ha...@gmail.com on 12 Jan 2012 at 7:12

GoogleCodeExporter commented 9 years ago
I've now implemented this. If you want to try it out please depend on version 
1.5.1-SNAPSHOT (will be released as version 1.6 though). You need the following 
snapshot repo:

<repositories>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots />
        </repository>
</repositories>

Original comment by johan.ha...@gmail.com on 16 Jan 2012 at 3:19