-
Notifications
You must be signed in to change notification settings - Fork 16
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
Release v0.13.0-M1 on jawn-0.12.x, fs2-1.0.0-M1 #23
Conversation
src/main/scala/jawnfs2/package.scala
Outdated
* | ||
* @param facade the Jawn facade to materialize `J` | ||
* @tparam J the JSON AST to return | ||
* @return the parsed JSON value, or the facade's concept of jnull if the source is empty | ||
*/ | ||
def runJson[J](implicit F: Sync[F], absorbable: Absorbable[O], facade: Facade[J]): F[J] = | ||
stream.parseJson(AsyncParser.SingleValue).compile.fold(facade.jnull())((_, json) => json) | ||
runJsonOption.map(_.getOrElse(facade.jnull())) |
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.
Maybe we should deprecate this one. Was null
ever really a sensible default / empty / zero JSON value in the first place?
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.
I am uncertain. technically using an optional decoder of a top level object the two valid states are nothing and null
, as a result I feel inclined this may still have a place.
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.
I'm not real fond of a default value like this where there isn't a monoid. Why is null
any more of a default than ""
or false
or {}
or []
or 0
?
I changed stuff
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.
👍 . But I would love if we had someone who was more a json expert weigh in on the option topic.
src/main/scala/jawnfs2/package.scala
Outdated
* | ||
* @param facade the Jawn facade to materialize `J` | ||
* @tparam J the JSON AST to return | ||
* @return the parsed JSON value, or the facade's concept of jnull if the source is empty | ||
*/ | ||
def runJson[J](implicit F: Sync[F], absorbable: Absorbable[O], facade: Facade[J]): F[J] = | ||
stream.parseJson(AsyncParser.SingleValue).compile.fold(facade.jnull())((_, json) => json) | ||
runJsonOption.map(_.getOrElse(facade.jnull())) |
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.
I am uncertain. technically using an optional decoder of a top level object the two valid states are nothing and null
, as a result I feel inclined this may still have a place.
Deprecated runJson, bumped to fs2-1.0.0-M1
Change in plans: going all the way to fs2-1.0.0-M1. This, plus zainab-ali/fs2-reactive-streams#50, should be enough to unblock a milestone for http4s. |
No description provided.