-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string assigned to variable leads to: Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL. #29
Comments
AppStore Jellycuts structure of is.workflow.actions.downloadurl
Open-Jellycore structure of is.workflow.actions.downloadurl
|
core of the problem seems to be "url: <#String (Allows Variables)#>" only dealing with the String path and ignoring the (Allows Variables) case downloadURL(url: <#String (Allows Variables)#>, method: <#Enumeration (WFHTTPMethod)#>, headers: <#Dictionary#>, requestType: <#Enumeration (WFHTTPBodyType)#>, requestJSON: <#Dictionary#>, requestVar: <#Variable#>) There are many actions in Documentation/Actions that allow PARAM: <#String (Allows Variables)#> Also, need to find others in
|
I verified that on all the 'import Action' functions that take one variable of tyep <#String (Allows Variables)#>
They all have the same issue, of using the variable name as a string instead of variable reference. So this issue appears to be present any function that takes a parameter of type <#String (Allows Variables)#>. While this may mean it affect over a 100 such functions, it likely that a single solution might fix all for them. |
see two commit for possible fix |
Describe the bug
string assigned to variable leads to: Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL.
Assignment of url to cmsURL, then used in downloadURL(url: cmsURL,... generates a "Get Contents of URL failed because Shortcuts couldn't convert from Rich text to URL." error
Import Shortcuts
//
dictionary() >> header
setValue(key: Content-Type, value: "application/json; charset=UTF-8", dictionary: header) >> header
//
var cmsURL = "https://jsonplaceholder.typicode.com/posts"
//
dictionary() >> reqDict
setValue(key:title, value: "My First Post", dictionary: reqDict) >> reqDict
setValue(key:body, value: "0.9", dictionary: reqDict) >> reqDict
setValue(key:userId, value:1, dictionary: reqDict) >> reqDict
//
downloadURL(
url: cmsURL,
method: POST,
headers: header,
requestType: Json,
requestJSON: reqDict,
requestVar: response) >> response
//
quicklook(input: response)
Working code with direct use of string:
import Shortcuts
//
dictionary() >> header
setValue(key: Content-Type, value: "application/json; charset=UTF-8", dictionary: header) >> header
//
dictionary() >> reqDict
setValue(key:title, value: "My First Post", dictionary: reqDict) >> reqDict
setValue(key:body, value: "0.9", dictionary: reqDict) >> reqDict
setValue(key:userId, value:1, dictionary: reqDict) >> reqDict
//
downloadURL(
url: "https://jsonplaceholder.typicode.com/posts",
method: POST,
headers: header,
requestType: Json,
requestJSON: reqDict,
requestVar: response) >> response
//
quicklook(input: response)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should preform the same as the second code snippet which runs without error
Screenshots
If applicable, add screenshots to help explain your problem.
Information
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: