Auto-generated code from 'live-documentation', which validates input, may fail with NPE or IndexOutOfBoundsException when validating collections. Pasting comment from JaxrsHelperGenerator.getAttributePath(): TODO: !=null and .isEmpty() checks for collections missing at this point due to complexity in adding them. Only the full check is added, e.g: disk.getTarget().getLogicalUnits().getLogicalUnits().get(0).getLunStorage()!=null this means the NullPointer or InderOutOfBound exceptions are possible for bad collection input How Reproducible (always, 100%): Add disk: POST .../api/disks <disk> <format>cow</format> <interface>ide</interface> <lun_storage/> </disk> This will result in NPE (disk.getLunStorage.getLogicalUnits().getLogicalUnits()) Add disk: POST .../api/disks <disk> <format>cow</format> <interface>ide</interface> <lun_storage> <type>nfs</type> <logical_units/> </lun_storage> </disk> This will result in IndexOutOfBoundException (disk.getLunStorage.getLogicalUnits().getLogicalUnits().get(0))
patch posted: https://gerrit.ovirt.org/#/c/84375/
Verified that POST requests in format suggested in the description don't yield NPE or IndexOutOfBoundException, but error message in following format is returned: <fault> <detail>LogicalUnit required for add</detail> <reason>Incomplete parameters</reason> </fault> Version 4.2.0-0.6
That's fine
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017. Since the problem described in this bug report should be resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.