Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restconf returns error when RPC generates "ok" reply #69

Closed
mgsmith1000 opened this issue Jan 17, 2019 · 2 comments
Closed

Restconf returns error when RPC generates "ok" reply #69

mgsmith1000 opened this issue Jan 17, 2019 · 2 comments

Comments

@mgsmith1000
Copy link
Contributor

mgsmith1000 commented Jan 17, 2019

I have an RPC defined in my data model:

rpc dataplane-control {
    input {
        leaf operation {
            mandatory true;
            type ngcom:service-operation;
            description
                "The operation to perform";
        }
        leaf option {
            type string;
            description
                "Option on operation";
        }
    }
    output {
        leaf stdout {
            type string;
        }
    }
}

When I invoke this RPC via restconf, the reply that is generated by the backend callback that is registered for this RPC only contains <ok/>. Restconf interprets this as an invalid reply:

  {
    "ietf-restconf:errors" : {
    "error": {
      "error-type": "application",
      "error-tag": "unknown-element",
      "error-info": {
        "bad-element": "ok"
      },
      "error-severity": "error"
      }
    }
  }

RFC 7950 section 7.14.4 says:

    If the RPC operation invocation succeeded and no output parameters
    are returned, the <rpc-reply> contains a single <ok/> element

The output parameter for the RPC is not mandatory, so a reply of <ok/> seems RFC-compliant.

@olofhagsand
Copy link
Member

Agree. The behaviour is wrong.

@olofhagsand
Copy link
Member

Sanity check removed for replies due to (1) wrong handling of (2) uncertain of handling of outgoing validation errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants