[NETCONF-461] RPC with all optional parameters returns 200 but is not invoked without content-type header Created: 24/Aug/17  Updated: 03/Dec/21  Resolved: 03/Dec/21

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Allan Clarke Assignee: Ivan Martiniak
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 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.



 Comments   
Comment by Ivan Martiniak [ 02/Dec/21 ]

As code has shifted, issue is not reproducible anymore.

Generated at Wed Feb 07 20:15:05 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.