Skip to content
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

Malformed json when encoding nested empty array #42

Open
RandomHashTags opened this issue Jul 19, 2024 · 0 comments
Open

Malformed json when encoding nested empty array #42

RandomHashTags opened this issue Jul 19, 2024 · 0 comments
Assignees

Comments

@RandomHashTags
Copy link

RandomHashTags commented Jul 19, 2024

Describe the bug
Title describes it.

Sample to Reproduce
Encoder used

static let json_encoder:IkigaJSONEncoder = {
    var encoder:IkigaJSONEncoder = IkigaJSONEncoder()
    encoder.settings.dateEncodingStrategy = .iso8601
    return encoder
}()

Nested Codable array

let array:[Set<String>]

Created array using

Array(repeating: Set(minimumCapacity: 12), count: 8)

Expected behavior
Expected result

{"array":[[],[],[],[],[],[],[],[]]}

Actual result

{"array":[[][][][][][][][]]}

Environment:

  • macOS 14.5 - Intel
  • Compilation Mode: Debug and Release
  • IkigaJSON Version: 2.2.2

Additional context
Encodes properly when the nested array's are populated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants