- final String withDefaultsStr = getSingleParameter(queryParams, WithDefaultsParam.uriName());
- if (withDefaultsStr != null) {
- final WithDefaultsParam val = WithDefaultsParam.forUriValue(withDefaultsStr);
- if (val == null) {
- throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
- "Invalid with-defaults parameter: " + withDefaultsStr, null,
- "The with-defaults parameter must be a string in " + POSSIBLE_WITH_DEFAULTS));
- }
+ if (paramName.equals(ContentParam.uriName())) {
+ final String str = optionalParam(paramName, paramValues);
+ if (str != null) {
+ content = RestconfDocumentedException.throwIfNull(ContentParam.forUriValue(str),
+ ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
+ "Invalid content parameter: %s, allowed values are %s", str, POSSIBLE_CONTENT);
+ }
+ } else if (paramName.equals(DepthParam.uriName())) {
+ final String str = optionalParam(paramName, paramValues);
+ try {
+ depth = DepthParam.forUriValue(str);
+ } catch (IllegalArgumentException e) {
+ throw new RestconfDocumentedException(e, new RestconfError(ErrorType.PROTOCOL,
+ ErrorTag.INVALID_VALUE, "Invalid depth parameter: " + str, null,
+ "The depth parameter must be an integer between 1 and 65535 or \"unbounded\""));
+ }
+ } else if (paramName.equals(FieldsParam.uriName())) {
+ final String str = optionalParam(paramName, paramValues);
+ if (str != null) {
+ try {
+ fields = FieldsParam.parse(str);
+ } catch (ParseException e) {
+ throw new RestconfDocumentedException(e, new RestconfError(ErrorType.PROTOCOL,
+ ErrorTag.INVALID_VALUE, "Invalid filds parameter: " + str));
+ }
+ }
+ } else if (paramName.equals(WithDefaultsParam.uriName())) {
+ final String str = optionalParam(paramName, paramValues);
+ if (str != null) {
+ final WithDefaultsParam val = WithDefaultsParam.forUriValue(str);
+ if (val == null) {
+ throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL,
+ ErrorTag.INVALID_VALUE, "Invalid with-defaults parameter: " + str, null,
+ "The with-defaults parameter must be a string in " + POSSIBLE_WITH_DEFAULTS));
+ }