Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-461

RPC with all optional parameters returns 200 but is not invoked without content-type header

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Cannot Reproduce
    • None
    • None
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    • 9052

    Description

      Clients can get a 200 back from a POST that is invoking an RPC that has
      all optional parameters but the RPC is actually never called. The code
      flow ends up in a @deprecated method (see details below).

      The call stack that leads to invoking the RPC go through RestconfCompositeWrapper in the first method below and those that fail to invoke the RPC go through the second method below (which happens to be deprecated)
      (line 64)
      @Override
      public NormalizedNodeContext invokeRpc(final String identifier, final NormalizedNodeContext payload,
      final UriInfo uriInfo)

      { return this.restconf.invokeRpc(identifier, payload, uriInfo); }

      @Override
      @Deprecated
      public NormalizedNodeContext invokeRpc(final String identifier, final String noPayload, final UriInfo uriInfo)

      { return this.restconf.invokeRpc(identifier, noPayload, uriInfo); }

      Lower on the call stack is the HttpMethodRule which uses a HttpMethodRule.Matcher around
      line 100 that uses the request media type in trying to figure out which method to call above.
      With CURL, the media type is set to "application/json" on the command line. With swagger,
      the media type is coming in as "text/plain" even though the swagger ui shows "application/json". So this is also a bug in swagger right now.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivanm1996 Ivan Martiniak
            aclarke@pobox.com Allan Clarke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: