Project

General

Profile

Actions

Bug #15227

closed

[API][Workbench] Adding tags via workbench1's tag editor saves the JSON string to properties

Added by Lucas Di Pentima over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Story points:
-
Release relationship:
Auto

Description

When viewing a collection with previosly saved tags, they're rendered ok on the editor, but when saving changes/new tags, the API server is saving them as a json string, for example:

...
properties: "{\"tagName\":\"tagValue\"}" 
...

This happens with the rails 5.0 api server and both rails 4.2 & 5.0 workbench1. OTOH, editing the collection with arv edit and manually setting the properties field works ok.


Subtasks 1 (0 open1 closed)

Task #15234: Review 15227-apiserver-properties-bugfixResolvedLucas Di Pentima05/17/2019Actions
Actions #1

Updated by Tom Clegg over 5 years ago

If the database has a json-encoded string (instead of a json-encoded hash) then it seems we have at least two bugs:
  1. apiserver is allowing non-objects into the properties field(s) -- if it's allowing clients to store strings, it might be allowing false, [], and null too
  2. apiserver is not decoding json-encoded parameters supplied by workbench (I'm guessing the problem is apiserver failing to decode, rather than workbench double-encoding, just because ISTR request parsing changed in the rails5 upgrade)
Actions #2

Updated by Lucas Di Pentima over 5 years ago

  • Status changed from New to In Progress
  • Assigned To set to Lucas Di Pentima
  • Target version set to 2019-05-22 Sprint
Actions #3

Updated by Lucas Di Pentima over 5 years ago

Updates at f337797b4 - branch 15227-apiserver-properties-bugfix
Test run: https://ci.curoverse.com/job/developer-run-tests/1240/

Fixes type checking on JSON attributes.

Actions #4

Updated by Tom Clegg over 5 years ago

This LGTM, thanks.

Actions #5

Updated by Lucas Di Pentima over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Tom Morris over 5 years ago

  • Release set to 15
Actions

Also available in: Atom PDF