Replies: 3 comments 6 replies
-
So let's call this proposed mode, the "discover" mode until we find a better name. I thought about having the discover mode detect primitive types only but then arrays inside a quoted string would not be picked up and it seems like in some cases that would be useful. So maybe discover mode needs two levels. Well, three if you consider the off state. Maybe elements inside string are not useful though. What are your thoughts? It also make sense to have a discover mode for the SEN format as that would allow the parser to detect Javascript objects and return then as JSON. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was brought up in issue #76 that a nice addition to OjG would be the ability to find JSON in a string or stream that contains other data besides just JSON. This topic is for discussion what the feature might look like.
Some thought that come to mind might be limiting the detection to JSON objects
{}
and arrays[]
. With that approach a string such asabc{"a":1}xyz
would detect{"a":1}
but a string such asabctruextz
would not detect thetrue
as a JSON element.Another consideration is what to do when the parser encounters a
{
or[
that is not part of a JSON. Possible actions could be to fail or to just continue looking for the next JSON.Beta Was this translation helpful? Give feedback.
All reactions