[NETCONF-215] API Explorer Model Schema Data Type 'Click to set as parameter value' is empty for YANG RPC POST to /operations/ Created: 02/Jun/16  Updated: 15/Mar/19  Resolved: 22/Sep/16

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

Type: Bug
Reporter: Michael Vorburger Assignee: Miroslav Kovac
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by NETCONF-214 API Explorer Model Schema Data Type '... Resolved
External issue ID: 5998

 Description   

For a YANG RPC like netconf POST to /operations/toaster:make-toast, that Data Type Model Schema for input is { } even though it should be something like {"input" :

{ "toaster:toasterDoneness" : "10", "toaster:toasterToastType":"wheat-bread" }

} it seems some mapping into Swagger's JSON isn't generated quite right there.



 Comments   
Comment by Miroslav Kovac [ 14/Sep/16 ]

https://git.opendaylight.org/gerrit/#/c/45580/2

Comment by Michael Vorburger [ 15/Sep/16 ]

I've just attempted to manually test c/45580/2, and seen that instead of the original:

{ }

it's now a bit better, but still not really working out-of-the-box:

{
"toasterDoneness": "integer",
"toasterToastType": {}
}

This is still wrong, as from what little I understand it should rather be something like:

{
"input" :

{ "toasterDoneness" : "1", "toasterToastType": "wheat-bread" }

}

Note the main diff is the missing "input" kind of wrap around it. (Putting valid example values, like "1" instead of "integer" and "wheat-bread" instead of {} would be cool too I guess, but I can open a separate issue about that, if you prefer.)

PS: The c/45580 also doesn't include any non-regression test (but that's not really my call).

Comment by Miroslav Kovac [ 16/Sep/16 ]

(In reply to Michael Vorburger from comment #2)
> I've just attempted to manually test c/45580/2, and seen that instead of the
> original:
>
> { }
>
> it's now a bit better, but still not really working out-of-the-box:
>
> {
> "toasterDoneness": "integer",
> "toasterToastType": {}
> }
>
> This is still wrong, as from what little I understand it should rather be
> something like:
>
> {
> "input" :

{ > "toasterDoneness" : "1", > "toasterToastType": "wheat-bread" > }

> }
>
> Note the main diff is the missing "input" kind of wrap around it. (Putting
> valid example values, like "1" instead of "integer" and "wheat-bread"
> instead of {} would be cool too I guess, but I can open a separate issue
> about that, if you prefer.)
>
> PS: The c/45580 also doesn't include any non-regression test (but that's not
> really my call).

Thank you for reply
Yes I know about that but this is opened as bug -> https://bugs.opendaylight.org/show_bug.cgi?id=5997
I fixed it so it would do the same thing as with config requests. Whenever the other bug will be fixed it should resolve this too. And I am currently working on that. If you want me to fix it in this bug i can do that too. But since there is opened bug for that I thought it would be better to do it there because the resolution will most likely be the same.

As for putting valid example values, separate issue would be better, cause it doesn`t have much to do with this and it should also be in config requests. And that would be an improvement I guess and not a bug.

Comment by Michael Vorburger [ 16/Sep/16 ]

> for putting valid example values, separate issue would be better

=> NETCONF-278

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