AdvancedPhotonSource / traveler

MIT License
3 stars 7 forks source link

User-entered data can then be retrieved via the keys #74

Closed dongliu closed 5 years ago

dongliu commented 5 years ago

[Separate from big card.]

dongliu commented 5 years ago

please check endpoint like /travelers/:id/keyvalue/json, it contains the key-value pairs beside other system defined key-value pairs.

shengb commented 5 years ago

Any example with for example curl?

When I was trying it with: $ curl -k -u apiuser:apipassword https://localhost:3443/apis/travelers/5bb4d03cf23a550900c2b906/ It returns a traveler in raw format, but did not see /keyvalue/json

dongliu commented 5 years ago

it was in the web application. added into api in https://github.com/AdvancedPhotonSource/traveler/pull/81

dongliu commented 5 years ago

try https://localhost:3443/apis/travelers/:id/keyvalue/

shengb commented 5 years ago

Good. It works.

iTerminate commented 5 years ago

The json should contain a key called keyvalue. Example: { 'title': 'title' 'status': 1 keyvalue: { 'key': 'value' 'key2': 'value2' } }

The problem is, currently I can override system keys by using the same keys in the traveler. I was able to get the output as shown below: { "id": "I just typed this id", "title": "3", "status": "My own STatus", "tags": [], "devices": [], "testxzcgds_sadf": "2", "1st": "sdg", "2nd": true }

dongliu commented 5 years ago

good catch, will fix it.

dongliu commented 5 years ago

fixed in https://github.com/AdvancedPhotonSource/traveler/pull/82

iTerminate commented 5 years ago

Looks Great! Thank You!