Fix boolean parsing leniency 92/89092/3
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 17 Apr 2020 10:46:00 +0000 (12:46 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 17 Apr 2020 10:57:55 +0000 (12:57 +0200)
commitf082f69b58909b0adf393771eae093fa6f09f00c
tree8efc81ee60915a91726207bce8c8742dffde2659
parentbc996a84b1d761752d02954fdb88677bba1acad7
Fix boolean parsing leniency

RFC7950 explicitly requires that booleans be encoded as lower-case
"true" or "false", not anything else. Our attempt at leniency misfires
as we are doing the wrong thing if a boolean is coupled with a string
in a union.

JIRA: YANGTOOLS-1097
Change-Id: I6da2f22db7bfb57eec7b519663f2a84fee735cd0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/BooleanStringCodec.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/BooleanCodecStringTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/YT1097Test.java [new file with mode: 0644]
yang/yang-data-impl/src/test/resources/yt1097.yang [new file with mode: 0644]