Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1492

Function & Action returning an enum throw an exception during dispatching

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • (Java) V4 4.8.0, (Java) V4 4.9.0
    • (Java) V4 5.0.1
    • odata4-server

    Description

      org.apache.olingo.server.core.ODataDispatcher throws a ODataHandlerException(NOT_IMPLEMENTED_MESSAGE,                            ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED) when dispatching a function or action which is returning an enum.

      Adding a "case ENUM:" in function handleFunctionDispatching like this:

          private void handleFunctionDispatching(final ODataRequest request, final ODataResponse response,
                  final UriResourceFunction uriResourceFunction) throws ODataApplicationException, ODataLibraryException
          {
              EdmFunction function = uriResourceFunction.getFunction();
              if (function == null)
              {
                  function = uriResourceFunction.getFunctionImport().getUnboundFunctions().get(0);
              }
              final EdmReturnType returnType = function.getReturnType();
              switch (returnType.getType().getKind())
              {
                  case ENTITY:
                      handleEntityDispatching(request, response,
                              returnType.isCollection() && uriResourceFunction.getKeyPredicates().isEmpty(), false);
                      break;
                  case PRIMITIVE:
                  case ENUM:
                      handlePrimitiveDispatching(request, response, returnType.isCollection());
                      break;
                  case COMPLEX:
                      handleComplexDispatching(request, response, returnType.isCollection());
                      break;
                  default:
                      throw new ODataHandlerException(NOT_IMPLEMENTED_MESSAGE,
                              ODataHandlerException.MessageKeys.FUNCTIONALITY_NOT_IMPLEMENTED);
              }
          }
      

       and similar in function handleActionDispatching solves the problem.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Boris.Fierlings Boris Fierlings

            Dates

              Created:
              Updated:

              Slack

                Issue deployment