# \#json3

**URL:** https://discourse.julialang.org/tag/json3/679.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [JSON.jl (v1.0) vs JSON3.jl for intensive struct materialization (20,000+ files)](https://discourse.julialang.org/t/json-jl-v1-0-vs-json3-jl-for-intensive-struct-materialization-20-000-files/136980)

<div class="topic-metadata">

**Author:** [@fchichorro](https://discourse.julialang.org/u/fchichorro)\
**Replies:** 4\
**Last updated:** [May 14, 2026, 10:31pm UTC](https://discourse.julialang.org/t/json-jl-v1-0-vs-json3-jl-for-intensive-struct-materialization-20-000-files/136980 "2026-05-14T22:31:22Z")

</div>

Hello everyone I have an ETL process that reads ~20,000 JSON files (avg. 60kb each), materializes them into nested structs, performs some operations, and saves them back to disk. I recently tried transitioning from JSO…

---

## [Generating structs from JSON files](https://discourse.julialang.org/t/generating-structs-from-json-files/136360)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 1\
**Last updated:** [March 24, 2026, 11:44pm UTC](https://discourse.julialang.org/t/generating-structs-from-json-files/136360 "2026-03-24T23:44:14Z")

</div>

I need to generate structs (and enums) from a set of JSON files. It seems that only JSON3.jl currently supports this feature? The migration guide does state: If you rely heavily on this feature, continue using JSON3.j…

---

## [How to print a vector on a single line with JSON3.jl](https://discourse.julialang.org/t/how-to-print-a-vector-on-a-single-line-with-json3-jl/128329)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 1\
**Last updated:** [April 23, 2025, 5:51pm UTC](https://discourse.julialang.org/t/how-to-print-a-vector-on-a-single-line-with-json3-jl/128329 "2025-04-23T17:51:13Z")

</div>

Hi, Is it possible to write a vector on a single line using JSON3.jl ?

---

## [JSON3 default values](https://discourse.julialang.org/t/json3-default-values/128324)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 0\
**Last updated:** [April 23, 2025, 9:57am UTC](https://discourse.julialang.org/t/json3-default-values/128324 "2025-04-23T09:57:17Z")

</div>

How can I add default parameters for a struct that is parsed using JSON3.jl ? Do I need to overload the StructTypes.construct method, or is there an easier way? Something like this: import JSON3 struct Foo foo::U…

---

## [How to efficiently parse null as NaN in JSON?](https://discourse.julialang.org/t/how-to-efficiently-parse-null-as-nan-in-json/121561)

<div class="topic-metadata">

**Author:** [@berjine](https://discourse.julialang.org/u/berjine)\
**Replies:** 1\
**Last updated:** [October 22, 2024, 12:00am UTC](https://discourse.julialang.org/t/how-to-efficiently-parse-null-as-nan-in-json/121561 "2024-10-22T00:00:10Z")

</div>

Hi I want to parse lines of JSON containing among other things a vector of signed ints with some values being “null”, like that : {"data":\[98,null,-51,null\]} The way I do it currently is by using a conversion function…

---

## [JSON3 read \`Dict{Tuple{Int,Int}, T}\` unexpected behavior](https://discourse.julialang.org/t/json3-read-dict-tuple-int-int-t-unexpected-behavior/117759)

<div class="topic-metadata">

**Author:** [@guimarqu](https://discourse.julialang.org/u/guimarqu)\
**Replies:** 4\
**Last updated:** [August 8, 2024, 3:24pm UTC](https://discourse.julialang.org/t/json3-read-dict-tuple-int-int-t-unexpected-behavior/117759 "2024-08-08T15:24:33Z")

</div>

Hey, I’m using JSON3.jl in a project and I found this unexpected behavior when reading Dict{Tuple{Int,Int}, T}. I don’t know if I’m doing something wrong or if there is just a bug in the package but this is a quite cla…

---

## [JSON3 to struct, how to improve deserialization performance?](https://discourse.julialang.org/t/json3-to-struct-how-to-improve-deserialization-performance/111667)

<div class="topic-metadata">

**Author:** [@Babiole](https://discourse.julialang.org/u/Babiole)\
**Replies:** 6\
**Last updated:** [March 20, 2024, 8:39am UTC](https://discourse.julialang.org/t/json3-to-struct-how-to-improve-deserialization-performance/111667 "2024-03-20T08:39:55Z")

</div>

Hi, I’m trying to create an application to distribute, this application is loading a JSON configuration file. Since I wanted a one to one binding between the application data and the JSON I’m using the JSON3 package. H…

---

## [JSON3 indexing nested object by string path](https://discourse.julialang.org/t/json3-indexing-nested-object-by-string-path/109056)

<div class="topic-metadata">

**Author:** [@alexgr](https://discourse.julialang.org/u/alexgr)\
**Replies:** 2\
**Last updated:** [January 20, 2024, 10:07pm UTC](https://discourse.julialang.org/t/json3-indexing-nested-object-by-string-path/109056 "2024-01-20T22:07:14Z")

</div>

Given: using JSON3 json\_string = """ { "name": "rocket1", "observations": \[ { "speed": "100", "acceleration": "1" }, { "speed": "200", "ac…

---

## [JSON3 string to Numeric](https://discourse.julialang.org/t/json3-string-to-numeric/96050)

<div class="topic-metadata">

**Author:** [@oliviermilla](https://discourse.julialang.org/u/oliviermilla)\
**Replies:** 2\
**Last updated:** [March 14, 2023, 11:55am UTC](https://discourse.julialang.org/t/json3-string-to-numeric/96050 "2023-03-14T11:55:16Z")

</div>

I have this API that returns all data as string: { value: "35.2" } Yet I want to map it to astruct with the proper type struct Data vaue::Float16 end How can I instruct JSON3 to do the conversion?

---

## [Saving complex numbers using JSON3](https://discourse.julialang.org/t/saving-complex-numbers-using-json3/83452)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 5\
**Last updated:** [June 28, 2022, 7:06pm UTC](https://discourse.julialang.org/t/saving-complex-numbers-using-json3/83452 "2022-06-28T19:06:11Z")

</div>

I am trying to save Complex numbers in json files formatted in a python compatible way as using JSON3 c = 1+5im d = Dict("c" =\> c) jsonstring = JSON3.pretty(d) #= should be { "c" : 1+5j } =# This is how far I got, …

---

## [JSON3.jl struct read](https://discourse.julialang.org/t/json3-jl-struct-read/80751)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [May 9, 2022, 7:55pm UTC](https://discourse.julialang.org/t/json3-jl-struct-read/80751 "2022-05-09T19:55:58Z")

</div>

using JSON3 struct Foo foo::Int bar::String end JSON3.StructTypes.StructType(::Type{Foo}) = JSON3.StructTypes.Struct() obj = Foo(1, "bar") If if just have the pure struct it works fine: julia\> json = JSON3.w…

---

## [Read and convert JSON file from a website](https://discourse.julialang.org/t/read-and-convert-json-file-from-a-website/79556)

<div class="topic-metadata">

**Author:** [@Aminath\_Shausan](https://discourse.julialang.org/u/Aminath_Shausan)\
**Replies:** 9\
**Last updated:** [April 24, 2022, 8:38am UTC](https://discourse.julialang.org/t/read-and-convert-json-file-from-a-website/79556 "2022-04-24T08:38:26Z")

</div>

Hi I am trying to download the json file from https://raw.githubusercontent.com/hodcroftlab/covariants/master/cluster\_tables/EUClusters\_data.json And then to save it as a csv file. At the moment I have used using CSV, …

---

## [Dash JSON3 error](https://discourse.julialang.org/t/dash-json3-error/74829)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 0\
**Last updated:** [January 18, 2022, 8:29pm UTC](https://discourse.julialang.org/t/dash-json3-error/74829 "2022-01-18T20:29:48Z")

</div>

I recently updated to Julia 1.7.1 and along with it some packages. My previously working Dash app now crashes with the following error when I want to plot something: ┌ Error: error handling request │ exception = │ …

---

## [Write StatsBase Histogram to JSON using JSON3](https://discourse.julialang.org/t/write-statsbase-histogram-to-json-using-json3/67601)

<div class="topic-metadata">

**Author:** [@Jonm](https://discourse.julialang.org/u/Jonm)\
**Replies:** 1\
**Last updated:** [September 7, 2021, 11:17pm UTC](https://discourse.julialang.org/t/write-statsbase-histogram-to-json-using-json3/67601 "2021-09-07T23:17:56Z")

</div>

With help from @quinnj, I thought I was getting the hang of writing structs to JSON using JSON3. I can’t seem to teach JSON3 to write the Histogram object from StatsBase.jl I have tried to use StructTypes.StructType(::…

---

## [Simplify JSON while deserializing into struct with StructTypes.jl](https://discourse.julialang.org/t/simplify-json-while-deserializing-into-struct-with-structtypes-jl/65484)

<div class="topic-metadata">

**Author:** [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Replies:** 9\
**Last updated:** [August 3, 2021, 6:58am UTC](https://discourse.julialang.org/t/simplify-json-while-deserializing-into-struct-with-structtypes-jl/65484 "2021-08-03T06:58:29Z")

</div>

Hi everyone, I have a relatively complex and nested JSON object (representing a patent application) which I would like to deserialize into a struct. However, I would like to “de-nest” the structure somewhat and between…

---

## [JSON3 and Tuples](https://discourse.julialang.org/t/json3-and-tuples/65699)

<div class="topic-metadata">

**Author:** [@Jonm](https://discourse.julialang.org/u/Jonm)\
**Replies:** 6\
**Last updated:** [August 3, 2021, 5:13am UTC](https://discourse.julialang.org/t/json3-and-tuples/65699 "2021-08-03T05:13:00Z")

</div>

I am having difficulty using JSON3 and a dictionary with Tuple keys. The first example works as expected the second does not. I have tried to use StructTypes to fix this, but I am missing something. dString=Dict("p1"=\>1…

---

## [JSON3.jl parse custom type with NaN](https://discourse.julialang.org/t/json3-jl-parse-custom-type-with-nan/61295)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [May 25, 2021, 3:45am UTC](https://discourse.julialang.org/t/json3-jl-parse-custom-type-with-nan/61295 "2021-05-25T03:45:49Z")

</div>

The following works: struct Foo a::Vector{Float64} b::Float64 end JSON3.StructType(::Type{Foo}) = JSON3.Struct() str = JSON3.write(Foo(\[NaN, 2.3\], NaN), allow\_inf=true) JSON3.read(str, Foo, allow\_inf=true) Wi…

---

## [Processing JSON from a .txt file and converting to a DataFrame](https://discourse.julialang.org/t/processing-json-from-a-txt-file-and-converting-to-a-dataframe/61119)

<div class="topic-metadata">

**Author:** [@clibassi](https://discourse.julialang.org/u/clibassi)\
**Replies:** 7\
**Last updated:** [May 15, 2021, 2:06am UTC](https://discourse.julialang.org/t/processing-json-from-a-txt-file-and-converting-to-a-dataframe/61119 "2021-05-15T02:06:35Z")

</div>

Hi all - I’m just looking for some insight into why the below code is returning a dataframe containing just the first line of my json file. If you’d like to try working with the file I’m working with, you can download t…

---

## [Parse a large array of small JSON objects?](https://discourse.julialang.org/t/parse-a-large-array-of-small-json-objects/61040)

<div class="topic-metadata">

**Author:** [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Replies:** 2\
**Last updated:** [May 12, 2021, 8:36pm UTC](https://discourse.julialang.org/t/parse-a-large-array-of-small-json-objects/61040 "2021-05-12T20:36:29Z")

</div>

Hi, I have a DataFrame that contains a column of several million JSON strings, e.g. julia\> DataFrame(j=""""{a": 1, "b": 2}""") julia\> pretty\_table(df) ┌──────────────────┐ │ j │ │ String │ ├───…

---

## [Abstract Types and StructTypes - error reading AbstractTypes into concrete with JSON3](https://discourse.julialang.org/t/abstract-types-and-structtypes-error-reading-abstracttypes-into-concrete-with-json3/60897)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 14\
**Last updated:** [May 12, 2021, 9:30am UTC](https://discourse.julialang.org/t/abstract-types-and-structtypes-error-reading-abstracttypes-into-concrete-with-json3/60897 "2021-05-12T09:30:07Z")

</div>

Hi, Believe I am running into a bit of a bug / unexpected behaviour that I can’t seem to work around when extracting an interface into a concrete type having defined more than one in a module. e.g.: this works: using…
