Project

General

Profile

Actions

Defect #20788

closed

REST API with JSON content missing attributes with false values

Added by 邵 岸 about 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Low
Category:
REST API
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

if an issue IS NOT private,using "GET /issues/<this_issue_id>.xml" can get "<is_private>false</is_private>" in the response;but if using "GET /issues/<this_issue_id>.json", there is no "is_private" key fonud in the response.

and the similar:
if a project IS NOT public,using "GET /projects/<this_project_id>.xml" can get "<is_public>false</is_public>" in the response;but if using "GET /issues/<this_project_id>.json", there is no "is_public" key fonud in the response.

Environment:
Redmine version 2.6.6.stable
Ruby version 2.0.0-p645 (2015-04-13) [x86_64-linux]
Rails version 3.2.22
Environment production
Database adapter Mysql2
SCM:
Subversion 1.7.10
Filesystem
Redmine plugins:
redmine_cas 1.2.1


Files

Actions #1

Updated by Go MAEDA over 8 years ago

  • Target version set to Candidate for next minor release
Actions #2

Updated by Yuichi HARADA about 6 years ago

JSON result was missing value of false or nil.

The reason is that we assume as 'true' the result of [false].any? . However actual this result is 'false'.
https://ruby-doc.org/core/Enumerable.html#method-i-any-3F

I made a patch, and attach it.

Actions #3

Updated by Go MAEDA about 6 years ago

  • Target version changed from Candidate for next minor release to 3.3.9

LGTM. Setting the target version to 3.3.9.

Actions #4

Updated by Jean-Philippe Lang almost 6 years ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Committed, thanks.

Actions #5

Updated by Jean-Philippe Lang almost 6 years ago

  • Subject changed from REST API with JSON content missing some keys to REST API with JSON content missing attributes with false values
Actions #6

Updated by Jean-Philippe Lang almost 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF