Uploaded image for project: 'controller'
  1. controller
  2. CONTROLLER-331

toaster:make-toast RPC allows invalid ToastType

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • restconf
    • None
    • Operating System: Linux
      Platform: PC

    • 762

    Description

      While invoking make-toast RPC, I specified an incorrect toasterToastType, ie "wheat-toast" instead of "wheat-bread":

      {
      "toaster:input" :

      { "toaster:toasterDoneness" : "3", "toaster:toasterToastType" : "wheat-toast" }

      }

      It got into the OpendaylightToaster.makeToast method fine although it threw an NPE because toastType was null. However since the toast type was invalid it should have been caught earlier and an exception thrown. The transformation from DOM input to MakeToastInput is done in a BindingCodec class that is generated on-the-fly from the MakeToastInput interface. The generated code actually calls LazyGeneratedCodecRegistry::IdentityCompositeCodec.deserialize which looks up the given "wheat-toast" qname in the qnamesToIdentityMap and just returns null if not found. It seems this method should throw an IllegalArgumentEx.

      Attachments

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

        Activity

          People

            tpantelis Tom Pantelis
            tpantelis Tom Pantelis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: