-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
jsonb_pretty
function
#4254
jsonb_pretty
function
#4254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening the PR!
The changes look good, I only would like to see some tests with NULL input (I explain the reason in yours other PR.
/// | ||
/// assert_eq!(r#"{ | ||
/// }"#, result); | ||
/// # Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test case with a None input?
/// # Ok(()) | ||
/// # } | ||
/// ``` | ||
fn jsonb_pretty<E: JsonbOrNullableJsonb + SingleValue>(e: E) -> Text; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn jsonb_pretty<E: JsonbOrNullableJsonb + SingleValue>(e: E) -> Text; | |
fn jsonb_pretty<E: JsonbOrNullableJsonb + MaybeNullableValue<Text> + SingleValue>(e: E) -> E::Out; |
to correctly handle null value inputs.
See the longer explanation here how this works. (You are not expected to know this on your own, I just don't want to copy this comment everywhere)
Thank you for the suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Added th
jsonb_pretty
function under Issue#4216