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


YANG syntax not honored

asked 2014-11-13 18:24:52 -0800

anonymous user


I have defined data model using YANG, with "mandatory true", "range 0..10", etc. Then via dlux apidoc/explorer, I put a JSON object in the leaf node that I have defined. The operation is successful; however, the 'mandatory' check is not really performed. The 'range' check is not performed. Basically I can put in a number exceeding the range or not specify the mandatory leaf value. Also, I would like to have my config data sorted in ascending numeric order of the key.

Q1: Is the ODL yang to java conversion tool not being to support those YANG syntax? Q2: Is the workaround to modify the yang--gen-code java code directly? Q3: How to implement "ordered-by user"?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-11-14 06:15:41 -0800

Tony Tkacik gravatar image

updated 2014-11-14 06:16:18 -0800

Validation of data is not yet fully supported in Helium due to resource constraints on YANG team.

For support / state see bug: - Milestone for Basic Validation, this is targeted to support:

  • range,
  • pattern
  • length constraints for simple types
  • config true / false validation,
  • leafref validation

Ordered-by user statement is supported by system - it should not reorder model parts marked as such, if this still happens for you, please open bug.

edit flag offensive delete publish link more


Thanks for the answer. I would like to have my config data sorted in ascending numeric order of the key. I don't see the current "ordered-by system" or "ordered-by user" able to achieve that. Am I missing something?

henryf ( 2014-11-15 23:07:04 -0800 )edit
Login/Signup to Answer

Question Tools



Asked: 2014-11-13 18:24:52 -0800

Seen: 272 times

Last updated: Nov 14 '14