rust-playground
rust-playground copied to clipboard
Gists created without descriptions cannot be loaded
Whenever i create a public gist using GitHub API, and try to open it on Rust playground using https://play.rust-lang.org/?gist=211bb09a91daf972934a13d6aee9e178; The editor isn't able to fetch contents of that gist. I looked into the console tab on inspect section on my browser, i saw a error of this kind.

on further inspection , i found out, the application fetches gist contents by sending GET request to https://play.rust-lang.org/meta/gist/211bb09a91daf972934a13d6aee9e178 and for all the gist created using API it is returning 500 server error.
Here is the curl request
curl -X POST \
-H "Authorization: token [my-token] " \
-H "Accept: application/vnd.github.v3+json" \
-d '{"public": true, "files": {"[filename]": {"filename": "my_public_file", "content": "pub fn main() { println!("test") }"}}}'
https://api.github.com/gists \
From the error log, it appears that your gist doesn't have a description field (Error("invalid type: null, expected a string", line: 1, column: 2879)).
This is a mistake in the definition of the model in octocrab. To resolve this:
- You'll need to submit a PR making that field optional or having a default value
- The PR will need to be merged
- A new release of octocrab
- The playground uses the new release
create a public gist using GitHub API
The playground creates gists using the API as well.