Details
-
Bug
-
Resolution: Done
-
Major
-
1.0.0.Alpha5
-
None
Description
The code inside ReadResourceHandler.doExecuteInternal(OperationContext context, ModelNode operation) goes as follows:
final int recursiveDepth = operation.get(ModelDescriptionConstants.RECURSIVE_DEPTH).asInt(0); final boolean recursive = recursiveDepth > 0 || operation.get(ModelDescriptionConstants.RECURSIVE).asBoolean(false);
The documentation states:
recursive-depth – (int) – The depth to which information about child resources should be included if recursive is {{true}. If not set, the depth will be unlimited; i.e. all descendant resources will be included.
The logic, however, as implemented goes - either recursive-depth is greater than zero OR recursive is true.
The proper implementation should be:
final int recursiveDepth = operation.get(ModelDescriptionConstants.RECURSIVE_DEPTH).asInt(0); final boolean recursive = operation.get(ModelDescriptionConstants.RECURSIVE).asBoolean(false) && (!operation.get(ModelDescriptionConstants.RECURSIVE_DEPTH).isDefined() || recursiveDepth > 0);
The above snippet works as follows: recurs IF recursive is set AND (either recursive-depth is not defined OR recursive-depth is greater than 0).
Attachments
Issue Links
- clones
-
WFLY-3705 read-resource recursive-depth has no effect when recursive=true
- Closed