tarantool / tarantool/tarantool

Make JSON encoder to be more stardatized

Open
#1,483 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

raw idea
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

Quote:

Numeric values that cannot be represented in the grammar below (such as Infinity and NaN) are not permitted.

  1. enable encode_invalid_as_nil and disable encode_invalid_numbers by default
  2. patch JSON to use more JavaScript like name for bad numbers: Infinity, -Infinity, NaN and -NaN (also isinf isn't, currently, used - https://github.com/mpx/lua-cjson/blob/master/lua_cjson.c#L592-L617)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the quoted JSON grammar and the linked lua_cjson.c lines 592-617, then trace how encode_invalid_as_nil and encode_invalid_numbers are handled. Check how invalid numeric values are currently named and determine the requested default settings and JavaScript-like spellings. The issue names no test file or test command, so completion would require verifying both option defaults and encoded output.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.