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

json.encode() escapes '/' #6200

Closed
vasilky3 opened this issue Jul 7, 2021 · 3 comments · Fixed by #6910
Closed

json.encode() escapes '/' #6200

vasilky3 opened this issue Jul 7, 2021 · 3 comments · Fixed by #6910
Assignees
Labels
2.11 Target is 2.11 and all newer release/master branches app bug Something isn't working

Comments

@vasilky3
Copy link

vasilky3 commented Jul 7, 2021

Приветствую, столкнулся с неожиданным экранированием в json модуле.

localhost:3501> t = {url = "https://srv:7777"}
---
...
localhost:3501> require('json').encode(t)
---
- '{"url":"https:\/\/srv:7777"}'
...

Json.encode экранирует /, по спеке это не обязательно. [rfc4627]

 All Unicode characters may be placed within the
   quotation marks except for the characters that must be escaped:
   quotation mark, reverse solidus, and the control characters (U+0000
   through U+001F).

NULL, NULL, NULL, NULL, NULL, NULL, NULL, "\\/",

Ожидаемое поведение:

localhost:3501> t = {url = "https://srv:7777"}
---
...
localhost:3501> require('json').encode(t)
---
- '{"url":"https://srv:7777"}'
...
@Totktonada Totktonada added the app label Jul 7, 2021
@vasilky3
Copy link
Author

vasilky3 commented Jul 9, 2021

Up. На стороне клиента также cjson. При decode() экранирование убирается.
Таким образом проблема решилась сама собой.

@kyukhin kyukhin closed this as completed Jul 13, 2021
@Totktonada
Copy link
Member

Please, share a reason why do you closed the issue if it was intentional. The problem is there.

@Totktonada Totktonada reopened this Jul 13, 2021
@kyukhin kyukhin added the bug Something isn't working label Jul 14, 2021
@kyukhin kyukhin added this to the wishlist milestone Jul 14, 2021
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Mar 10, 2022
For unknown reason in upstream lua_cjson slash symbol was escaped
while according to the standart [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

Escapes table fixed and related test added.

Fixes tarantool#6200
NO_DOC=bugfix
@Totktonada
Copy link
Member

Totktonada commented Mar 11, 2022

A bit more context:


What is also interesting: does anyone verify the char2escape table to spot all cases, where it escapes symbols that are optional for escape? Are there other such cases?


This issue also let me summarize some thoughts on backward compabilility mechanisms: #6912.

Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Mar 12, 2022
For unknown reason in upstream lua_cjson slash symbol was escaped
while according to the standart [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

Escapes table fixed and related test added.

Fixes tarantool#6200
NO_DOC=bugfix
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Mar 14, 2022
For unknown reason in upstream lua_cjson slash symbol was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

Escapes table fixed and related test added.

Fixes tarantool#6200
NO_DOC=bugfix
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 21, 2022
Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed
on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool comparability
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 21, 2022
Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed
on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool comparability
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 21, 2022
Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool comparability
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 22, 2022
Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool comparability
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 28, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
https://github.com/Lord-KA/doc/blob/Lord-KA/gh-7000-compat-module/doc/getting_started/using_compat.rst

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://github.com/tarantool/tarantool/wiki/compat_json_escape_forward_slash"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every build-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 28, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
https://github.com/Lord-KA/doc/blob/Lord-KA/gh-7000-compat-module/doc/getting_started/using_compat.rst

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://github.com/tarantool/tarantool/wiki/compat_json_escape_forward_slash"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every build-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 28, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
https://github.com/Lord-KA/doc/blob/Lord-KA/gh-7000-compat-module/doc/getting_started/using_compat.rst

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://github.com/tarantool/tarantool/wiki/compat_json_escape_forward_slash"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every build-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Apr 29, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
https://github.com/Lord-KA/doc/blob/Lord-KA/gh-7000-compat-module/doc/getting_started/using_compat.rst

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://github.com/tarantool/tarantool/wiki/compat_json_escape_forward_slash"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every build-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue May 4, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
https://github.com/Lord-KA/doc/blob/Lord-KA/gh-7000-compat-module/doc/getting_started/using_compat.rst

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://github.com/tarantool/tarantool/wiki/compat_json_escape_forward_slash"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every built-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue May 4, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json-escape-forward-slash
option to compat and its logic in lua_cjson and msgpuck.

Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue May 4, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
tarantool#6912 (comment)

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://tarantool.io"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every built-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue May 4, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - old behavior is frozen and its logic is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as frozen.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

More examples on the interface usage can be found here
tarantool#6912 (comment)

To add option to compat src one needs to insert its info into options
table:

```lua
local options = {
    json_escape_forward_slash = {
        old = true,
        new = false,
        default = true,
        brief = "<...>",
        doc  = "https://tarantool.io"
    }
}
```

And add its postaction to postactions table (if the option is frozen, no
need for postaction):

```lua
local postaction = {
    json_escape_forward_slash = function(value)
        print(("esc_slash postaction was called with value %d!"):format(value))
    end
}
```

Every built-in option must have a Tarantool wiki page with detailed description,
list of known compatibility issues and some tips on detecting problems in
codebase. For example, see json_escape_forward_slash patch (tarantoolgh-6200).
Lord-KA added a commit to Lord-KA/msgpuck that referenced this issue May 4, 2022
It was decided that lua_cjson should have [tarantool.compat](tarantool/tarantool#7000)
option that allows to toggle escaping '/'. For consistancy msgpuck is to
switch the behavior too.

This patch provides function that sets '/' to be escaped or not.

Needed for tarantool/tarantool#6200
Lord-KA added a commit to Lord-KA/msgpuck that referenced this issue May 4, 2022
It was decided that lua_cjson should have tarantool.compat (tarantool/tarantool#7000)
option that allows to toggle escaping '/'. For consistancy msgpuck is to
switch the behavior too.

This patch provides function that sets '/' to be escaped or not.

Needed for tarantool/tarantool#6200
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 7, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 8, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 17, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 17, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 18, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 22, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 30, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 30, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Nov 30, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 5, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 5, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 5, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 5, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 5, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here:
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 6, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here (private):
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
igormunkin pushed a commit that referenced this issue Dec 6, 2022
As a followup to #6200 and a result of #6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes #7000
Needed for #6200
See also #6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here (private):
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 6, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 6, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Requires tarantool#8007
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 8, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Requires tarantool#8007
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 8, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Requires tarantool#8007
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 9, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Requires tarantool#8007
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 9, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Requires tarantool#8007
Fixes tarantool#6200
See also tarantool#7000
NO_DOC=docs on tarantool.wiki
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Dec 9, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (tarantoolgh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires tarantool#7060
Requires tarantool#8007
Fixes tarantool#6200
See also tarantool#7000

@TarantoolBot document
Title: new compat option json_escape_forward_slash

In the new behavior forward slash is not escaped in `json.encode()`
and msgpack:

```
tarantool> compat.json_escape_forward_slash = 'new'
---
...

tarantool> json.encode('/')
---
- '"/"'
...

tarantool> compat.json_escape_forward_slash = 'old'
---
...

tarantool> json.encode('/')
---
- '"\/"'
...
```
igormunkin pushed a commit that referenced this issue Dec 9, 2022
For unknown reason in upstream lua_cjson '/' was escaped
while according to the standard [rfc4627] it is unnecessary and is
questionably compatible with other implementations.

It was decided that the change will be introduced using
tarantool.compat (gh-7000). The patch adds json_escape_forward_slash
option to compat and its logic in lua_cjson and msgpuck.

Requires #7060
Requires #8007
Fixes #6200
See also #7000

@TarantoolBot document
Title: new compat option json_escape_forward_slash

In the new behavior forward slash is not escaped in `json.encode()`
and msgpack:

```
tarantool> compat.json_escape_forward_slash = 'new'
---
...

tarantool> json.encode('/')
---
- '"/"'
...

tarantool> compat.json_escape_forward_slash = 'old'
---
...

tarantool> json.encode('/')
---
- '"\/"'
...
```
ligurio pushed a commit to ligurio/tarantool that referenced this issue Dec 12, 2022
As a followup to tarantool#6200 and a result of tarantool#6912, Tarantool compatibility
module was implemented to simplify introduction of debatable behavior
changes.

Closes tarantool#7000
Needed for tarantool#6200
See also tarantool#6912

@TarantoolBot document
Title: Tarantool compatibility module

Compat module is basically a global options table with additional
verbose interface and helper functions. There are tree stages of
changing a behavior:
 - old behavior by default
 - new behavior by default
 - new behavior is frozen and the old behavior is removed

on first two stages user can toggle options via interface and change the
behavior according to his needs, on the last stage old behavior is
removed from codebase and option is marked as obsolete.
As compat is a global instance, options can be hardcoded into it or
added in runtime e.g. by external module.

There should be a link to tarantool.wiki/compat on the doc page. There
are pages for each existing option with detailed description, list of
known compatibility issues and some tips on detecting problems in codebase.

Tutorial can be found here:
https://github.com/tarantool/tarantool/wiki/compat%3Atutorial

Full API description is here (private):
https://www.notion.so/tarantool/tarantool-compat-introduce-compatibility-module-to-tarantool-8cb33e23932b490384c05f1cdfbf7baa
locker added a commit to locker/tarantool-msgpuck that referenced this issue Feb 1, 2023
mp_snprint formats MsgPack data as a JSON-like string. According to
the JSON format, the forward slash character isn't supposed to be
escaped, but mp_snprint does escape it. Let's fix this.

Note, this should be fine from the Tarantool compatibility point of
view, because Tarantool uses this function only for presenting MsgPack
data in an unspecified human-readable format, e.g. when printing to
the log. If we need to format MsgPack data as valid JSON, we should use
the internal Tarantool JSON encoder which respects the JSON serializer
config and compat module options.

See tarantool/tarantool#6200
kyukhin pushed a commit to tarantool/msgpuck that referenced this issue Feb 2, 2023
mp_snprint formats MsgPack data as a JSON-like string. According to
the JSON format, the forward slash character isn't supposed to be
escaped, but mp_snprint does escape it. Let's fix this.

Note, this should be fine from the Tarantool compatibility point of
view, because Tarantool uses this function only for presenting MsgPack
data in an unspecified human-readable format, e.g. when printing to
the log. If we need to format MsgPack data as valid JSON, we should use
the internal Tarantool JSON encoder which respects the JSON serializer
config and compat module options.

See tarantool/tarantool#6200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.11 Target is 2.11 and all newer release/master branches app bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants