Page MenuHomePhabricator

Reference variable for the current user on Conduit Method Call page
Closed, WontfixPublic

Description

It'd be really nice to be able to reference the current user through a reference variable like ${me.phid}, so testing out the responses to various conduit method calls can be easier.

Event Timeline

ox raised the priority of this task from to Needs Triage.
ox updated the task description. (Show Details)
ox added a project: Conduit.
ox changed the edit policy from "All Users" to "Task Author".
ox added a subscriber: ox.
epriestley claimed this task.
epriestley added a subscriber: epriestley.

We haven't seen other requests for this and I don't think it's very straightforward. Consider these JSON values:

[{$me.phid}]
["{$me.phid}"]

If we just find/replace, we'll get one of these wrong, and neither of them is the obviously-correct way to use a variable to me.

We could maybe just write your PHID on the page somewhere (like in a "Common variables" table) but it's hard for me to come up with any other values we might want to put there. Your PHID is also stable and you can just write it down in a text file somewhere, which is only slightly more cumbersome.

We haven't seen other requests for this and I don't think it's very straightforward. Consider these JSON values:

[{$me.phid}]
["{$me.phid}"]

The former value is not valid JSON though?

It would be easier to implement this if we say the second form is required (enter JSON -> parse JSON -> interpolate the variable in stirings), but I think it's not intuitive that you can't just type {$me.phid} into a field like authorPHID. Certainly, I'd expect that if the console supported variables they'd be proper-value-variables, not string-interpolation-variables, since string interpolation is completely useless except that it's easier to implement.