- return new NormalizedNodeContext(iiWithData, data);
- }
-
- // FIXME: Move this to proper place
- @SuppressWarnings("unused")
- private Integer parseDepthParameter(final UriInfo info) {
- final String param = info.getQueryParameters(false).getFirst(UriParameters.DEPTH.toString());
- if (Strings.isNullOrEmpty(param) || "unbounded".equals(param)) {
- return null;
- }
-
- try {
- final Integer depth = Integer.valueOf(param);
- if (depth < 1) {
- throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
- "Invalid depth parameter: " + depth, null,
- "The depth parameter must be an integer > 1 or \"unbounded\""));
- }
-
- return depth;
- } catch (final NumberFormatException e) {
- throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
- "Invalid depth parameter: " + e.getMessage(), null,
- "The depth parameter must be an integer > 1 or \"unbounded\""));
- }
+ return new NormalizedNodeContext(iiWithData, data, QueryParametersParser.parseKnownWriterParameters(uriInfo));