Multipart representation creation crashes when an "optional" field has no value specified

Bug #430152 reported by Leonard Richardson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wadllib
Fix Released
Undecided
Unassigned

Bug Description

Adding this line to one of the sample WADL files will make the tests fail.

=== modified file 'src/wadllib/tests/data/multipart-binary-wadl.xml'
--- src/wadllib/tests/data/multipart-binary-wadl.xml 2009-05-06 16:37:44 +0000
+++ src/wadllib/tests/data/multipart-binary-wadl.xml 2009-09-15 16:33:40 +0000
@@ -12,6 +12,7 @@
       <request>
           <representation mediaType="multipart/form-data">
             <param style="plain" name="text_field" required="true" />
+ <param style="plain" name="optional_field" />
             <param style="plain" name="binary_field" type="binary"
                    required="true" />
           </representation>

The code in bind() tries to get a value for every single parameter defined in the representation, even optional ones. If you didn't specify a value for the parameter, bind() crashes.

This should be simple to fix.

Changed in wadllib:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.