tarantool / tarantool/http

`req:render({json = box.NULL})` doesn't work

Open Beginner friendly
#227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
81
Forks
41
PR merge metrics
No merged PRs in 30d

Description

I want to return null explicitly from my handler.

But there is a check in the code that prevents that:
https://github.com/tarantool/http/blob/9b73cab45c031dd658c718e60a69966336d6c73f/http/server.lua#L454

Seems it should be if type(opts.json) ~= 'nil' then

Contributor guide

No contributing guide indexed for this repository

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 in http/server.lua at line 454, where the JSON option is checked during req:render. Reproduce req:render({json = box.NULL}) and verify that the handler can explicitly return JSON null without the option being rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.