Skip to content
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

fix: wrap.info for polywrap python plugin #104

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified implementations/plugin-python/build/wrap.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion implementations/plugin-python/polywrap.deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
package: http
uri: $$ipfs_deploy
config:
postUrl: https://wraps.wrapscan.io/r/polywrap/plugin-python-abi-bindgen@1.0.0
postUrl: https://wraps.wrapscan.io/r/polywrap/plugin-python-abi-bindgen@1.0.1
headers:
- name: Authorization
value: $POLYWRAP_WRAPSCAN_AUTH_HEADER_PROD
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ type Module @imports(
mapOfArrOfObj: Map! @annotate(type: "Map<String!, [AnotherType!]!>!")
): Int!

"""
objectMethod docstring
is multiline.
"""
objectMethod(
object: AnotherType!
optObject: AnotherType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@
"type": "[AnotherType]"
}
],
"comment": "objectMethod docstring\\nis multiline.",
"env": {
"required": true
},
Expand Down
5 changes: 4 additions & 1 deletion implementations/plugin-python/src/helpers/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ use handlebars::handlebars_helper;
use serde_json::{Value};

handlebars_helper!(pretty: |value: Value| {
serde_json::to_string_pretty(&value).unwrap()
let json_str = serde_json::to_string(&value).unwrap();
let escaped_json_str = json_str.replace("\\n", "\\\\n"); // escape backslashes
let escaped_val = serde_json::from_str::<Value>(&escaped_json_str).unwrap();
serde_json::to_string_pretty(&escaped_val).unwrap()
});
Loading