-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lyd_new_path handle json encoded string leaves #2132
lyd_new_path handle json encoded string leaves #2132
Conversation
d3291a0
to
ac37485
Compare
According to ietf rfc 8259, strings are always surrounded by double quotes. This means, for storing within libyang, we must strip input data of these, and take the value as the stripped portion. Example: const char * data = "\"Great View\""; should yield const char *value = "Great View"; For this, a new option is used `LYD_NEW_PATH_JSON_VALUE`
ac37485
to
a4d739f
Compare
Could you please reference the exact text that mentions this feature? |
https://datatracker.ietf.org/doc/html/rfc8259#section-7
|
I read that and, to my understanding, it means the quotation marks should be escaped (and I believe they are), not removed. |
This change addresses this part of the RFC Normally, lyd_new_path would be passed but when decoding from gnmi, we would get However, we must consider the value as |
What is the use case for feeding libyang with JSON-encoded string values? How is this different from, say, Base64-encoded string values or RFC2047-style encoded string values? How do you plan to use this, and why is it needed to put this feature into libyang? |
Each string value in JSON is encoded as |
I understand. Will keep this changeset in gnmi where it should belong. |
According to ietf rfc 8259, strings are always surrounded by double
quotes. This means, for storing within libyang, we must strip input
data of these, and take the value as the stripped portion.
Example: const char * data = ""Great View""; should yield
const char *value = "Great View";
For this, a new option is used
LYD_NEW_PATH_JSON_VALUE