Skip to content
#

json-parser

Here are 769 public repositories matching this topic...

jethmalani
jethmalani commented Nov 14, 2017

What did you do?

When I do this (from your docs):

guard let dataFromString = text.data(using: .utf8, allowLossyConversion: false) else {return} let json = JSON(data: dataFromString)

I get an error "Call can throw, but it is not marked with 'try' and the error is not handled"

I did this. I just want to confirm that is right. It worked for me.

`guard let dataFromString

json
jean-airoldie
jean-airoldie commented Jun 6, 2019

Here is some general documentation improvement suggestion regarding flatbuffers. This is what I remember struggling with (from the top of my head). Also some point might be a little bit opinionated.

Some of the points were taken from #5387.

  • Regarding the builder:
    • The fact that its kinda like an arena allocator used for serialization.
    • The concept of offsets, what do they repre
zachelrath
zachelrath commented Jul 9, 2019

Currently, when SortMapKeys is set to true in Config, map keys are sorted using a standard alphanumeric sort. It should be possible to specify a custom map key sorting function to use, in order to prioritize certain map keys over others.

Example: Standard SortMapKeys behavior:

cfg := jsoniter.Config{
   SortMapKeys: true,
}.Froze()

m := map[string]int{
   "beta": 2,
   "alp
egdeliya
egdeliya commented Apr 24, 2020

Hi! Kind of really impressed with your library ❤️

But I have some issues with UnknownField null values. It is reproducible with the following test

func TestUnknownFieldsProxyNullField(t *testing.T) {
	baseJson := `{"Field1":"123","Field2":null}`

	s := StructWithUnknownsProxy{}

	err := s.UnmarshalJSON([]byte(baseJson))
	if err != nil {
		t.Errorf("UnmarshalJSON didn't expec
kaaboaye
kaaboaye commented May 4, 2020

If json contains the following string <!-- anything here <script> it will comment out the rest of HTML braking the website.

The problem?

Adding the :html_safe to encode/2 doesn't escape this sequence.

Reproduction

<script>
const a = "<!-- <script>"
</script>
<h1>This is commented out</h1>

Why is that?

Because of the HTML Spec https://html.spec.what

Improve this page

Add a description, image, and links to the json-parser topic page so that developers can more easily learn about it.

Curate this topic

Add this topic to your repo

To associate your repository with the json-parser topic, visit your repo's landing page and select "manage topics."

Learn more

You can’t perform that action at this time.