aboutsummaryrefslogtreecommitdiff
path: root/core/encoding/json
Commit message (Collapse)AuthorAgeFilesLines
* fix unmarshalling bit sets in jsonLaytan Laats2025-03-221-2/+18
| | | | Fixes #4761
* encoding/json: marshal enumerated arrays to objects with key-value pairsjkenda2025-02-011-3/+13
|
* Remove unnecessary string() conversion.dozn2024-12-281-1/+1
|
* Use Struct Tags For Embedded (with `using`) Structs When Unmarshalling JSONdozn2024-12-281-1/+1
| | | A fix for https://github.com/odin-lang/Odin/issues/4539
* fix #4536 - stack buffer overflow for size_of 0 types in struct unmarshalLaytan Laats2024-12-061-1/+1
|
* Merge pull request #4562 from dozn/patch-1gingerBill2024-12-061-3/+3
|\ | | | | Move Struct Field Zipping Outside of Loop
| * Move Struct Field Zipping Outside of JSON Token Loopdozn2024-12-051-3/+3
| |
* | Fix #4537gingerBill2024-12-051-0/+1
|/
* Fix #4549gingerBill2024-12-021-1/+1
|
* fix unmarshal unhandled error (#4515)o:tone2024-11-251-1/+1
| | | * fix unmarshal unhandled error
* Check for more errors in json.unmarshalgingerBill2024-11-141-15/+34
|
* Remove relative types from json marshallergingerBill2024-11-141-6/+0
|
* encoding/json: fix leak when string is unmarshalled into non-string fieldLaytan Laats2024-10-191-5/+10
| | | | Fixes #4391
* unmarshal bitset ints like cbor doesjakubtomsu2024-09-041-1/+24
|
* Allow json to unmarshal empty struct.Jeroen van Rijn2024-07-211-2/+1
|
* Merge pull request #3910 from VladPavliuk/json-add-int-key-map-supportgingerBill2024-07-142-41/+67
|\ | | | | Allow to `marshal` and `unmarshal` maps with int keys
| * Merge branch 'master' into json-add-int-key-map-supportVladPavliuk2024-07-141-0/+5
| |\
| * | Allow to `marshal` and `unmarshal` maps with int keysVladPavliuk2024-07-132-41/+67
| | |
* | | Reduce the size of `runtime.Type_Info`gingerBill2024-07-142-2/+2
| |/ |/|
* | Align ignore syntax of json tags with fmt, cborVladPavliuk2024-07-141-3/+6
| |
* | Add support of `ignore` tag for `json.marshal`VladPavliuk2024-07-131-1/+3
|/
* Fix loads of indentation issues with mixing spaces and tabsgingerBill2024-06-291-4/+4
|
* Merge branch 'odin-lang:master' into fix-omitempty-commakorvahkh2024-06-133-41/+42
|\
| * Port `tests\core\encoding\json`Jeroen van Rijn2024-06-023-41/+42
| |
* | encoding/json: Fix struct marshal() emitting comma after omitted fieldkorvahkh2024-05-271-15/+17
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously: ```odin package main import "core:fmt" import "core:encoding/json" T :: struct { a: string `json:",omitempty"`, b: string, } main :: proc() { data, _ := json.marshal(T{b = "foo"}) fmt.println(string(data)) } ``` would output: ``` {,"b":"foo"} ``` which is not correct. Also cleaned up some whitespace while I'm at it.
* fix(core/encoding/json): remove Unsupported_Type return when marshalling bit_setIllusionMan12122024-05-251-2/+0
|
* encoding/json: Properly marshal `#no_nil` unionskorvahkh2024-05-111-5/+8
| | | | | Previously the first variant of a `#no_nil` would always be output as `null`, and following variants would be treated as the wrong type.
* Fix `omitempty` in `json.marshal`Feoramund2024-04-272-2/+2
|
* Update numerous package declaration namesgingerBill2024-04-186-6/+6
|
* Add `json:"name,omitempty"`gingerBill2024-04-102-10/+60
|
* Allow for comma-separate json names `json:"name,flag"`gingerBill2024-04-102-1/+11
|
* correct newly found vetsLaytan Laats2024-04-032-13/+12
|
* Json: improved unmarshalling of `using _: T` fields.Franz Höltermann2024-03-271-9/+41
| | | | | | | | | | | | | | | | | | | | | `using _: T` fields will now have their members unmarshalled to their parent types reflecting the new behaviour of json.marshall. Example: ```go A :: struct { using _: B, } B :: struct { field: string, } data := `{"field": "Hello World"}` a: A json.unmarshal_string(data, &a) ```
* Json: fields on structs like 'using _: T' will now have T's fieldsFranz Höltermann2024-03-261-14/+27
| | | | | | marshalled directly into the parent type without an '"_":{ ... }'. This seems like desirable behavior to me, since you can't access the fields with 'Parent_Type._.field' either.
* Merge pull request #3215 from blob1807/json-better-enum-supportgingerBill2024-03-061-1/+15
|\ | | | | core:encoding/json Add support for writing enum value names
| * Apply suggestions from code review blob18072024-03-041-2/+2
| | | | | | | | | | Fixing spelling mistakes pointed out & fixed by layton. Co-authored-by: Laytan <laytanlaats@hotmail.com>
| * convert spaces to tabsblob18072024-03-041-1/+1
| |
| * Return underlining value instead of panicingblob18072024-03-041-4/+6
| | | | | | | | | | | | | | | | when no name it found. Renamed use_enum_value_names to use_enum_names it get the same point across & inline with the reflect procs
| * changed to use reflect.enum_name_from_value_anyblob18072024-03-011-34/+2
| |
| * Merge branch 'odin-lang:master' into json-better-enum-supportblob18072024-03-011-0/+3
| |\
| * | add all inter types to switchblob18072024-02-211-3/+27
| | |
| * | replace spaces with tabsblob18072024-02-211-19/+19
| | |
| * | add missing commablob18072024-02-211-1/+1
| | |
| * | Add better support for Enums in jsonblob18072024-02-211-1/+21
| | | | | | | | | | | | Can now output enum value's name instead of its underlineing value
| * | Revert json union fixblob18072024-02-211-9/+0
| | |
| * | Merge branch 'master' of https://github.com/blob1807/Odinblob18072024-02-211-1/+0
| |\ \
| * | | Fix bug https://github.com/odin-lang/Odin/issues/3173blob18072024-02-211-0/+9
| | | |
* | | | Fix #3173gingerBill2024-03-061-0/+5
| | | |
* | | | Zero `intrinsics.alloca`gingerBill2024-03-061-2/+5
| | | |
* | | | Use `intrinsics.alloca` rather than `context.temp_allocator` in ↵gingerBill2024-03-061-5/+8
| | | | | | | | | | | | | | | | `json.unmarshal_object`