Ask is moving to Stack Overflow and Serverfault.com! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode

1

How does JSON request input get valdiated in OpenDaylight

asked 2016-09-25 17:48:44 -0800

Hi,

I am trying to understand that we invoke an RPC through restconf by providing request in json format, how this json request gets validated against yang model.

Any information will be much appreciated...!!

Thanks Kanika

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2016-10-21 07:25:12 -0800

Hello Kanika,

YangTools project is provide XML and JSON codec to translate payload to NormalizedNode, which is the Java representation of the YANG model. At the time of the de-serialization, when the request hit the server, the payload is translated using those codec. See here for the JSON and XML (un)marshaller.

Hope this helps, Alexis

edit flag offensive delete publish link more
0

answered 2016-09-26 17:07:21 -0800

mahanare gravatar image

may be you need to provide more details. what exactly you need?

when we define yang model and RPCs within it and provide its implementation and once the karaf is started, you should be able to use the RPCs. you may want to refer to JSONRestconfSergiceImpl.java (sal-rest-connector) or debug this module (download restconf code https://github.com/opendaylight/netco... and debug the flow as you test your code).

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2016-09-25 17:48:44 -0800

Seen: 34 times

Last updated: Oct 21 '16