[CONTROLLER-707] PUT fails to validate outer object name in json Created: 19/Aug/14  Updated: 14/Nov/17  Resolved: 11/Sep/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Devin Avery Assignee: Jozef Gloncak
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


External issue ID: 1582

 Description   

I found that if I perform a PUT to toaster I am able to define any content for the outer module name. That is I can do a PUT to:

http://localhost:8181/restconf/config/toaster:toaster

with this body:

{
"ANY_TEXT_YOU_WANT":

{ darknessFactor:"4" }

}

Essentially the ANY_TEXT_YOU_WANT is completely ignored by the parser. We should either validate it, or better yet, do NOT require it. That is I should be able to PUT to the above toaster URL just

{
darknessFactor:"4"
}

since I am already in the context of toaster based on the URL.

I do not know if the same problem exists with XML.



 Comments   
Comment by Jozef Gloncak [ 08/Sep/14 ]

Higher described behavior was caused with normalizedNodeName() which ignores nodeBuilder's localName and use QName from schemaNode which is specified as input of this method.

Validation method was added befare normalization call.

Patch set
https://git.opendaylight.org/gerrit/#/c/10903/

Comment by Jozef Gloncak [ 08/Sep/14 ]

BTW, the same behavior was also identified in XML

Generated at Wed Feb 07 19:53:40 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.