summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@noreply.codeberg.org>2024-04-26 18:19:06 +0200
committerCyborus <cyborus@noreply.codeberg.org>2024-04-26 18:19:06 +0200
commit43e2f85b82ce91946aca3dfe5de178bbd4d228a2 (patch)
tree7442f559f87532faa1597fe16a85bb7a98a628f2
parentMerge pull request 'update to Forgejo 7.0's API' (#46) from v7.0 into main (diff)
parentfix `repo_get_raw_file{_or_lfs}` not returning `Vec<u8>` (diff)
downloadforgejo-api-43e2f85b82ce91946aca3dfe5de178bbd4d228a2.tar.xz
forgejo-api-43e2f85b82ce91946aca3dfe5de178bbd4d228a2.zip
Merge pull request 'fix `repo_get_raw_file{_or_lfs}` not returning `Vec<u8>`' (#47) from raw-file-fix into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-api/pulls/47
-rw-r--r--src/generated/methods.rs8
-rw-r--r--swagger.v1.json3
2 files changed, 6 insertions, 5 deletions
diff --git a/src/generated/methods.rs b/src/generated/methods.rs
index 9cc914f..c2404c9 100644
--- a/src/generated/methods.rs
+++ b/src/generated/methods.rs
@@ -4309,13 +4309,13 @@ impl crate::Forgejo {
repo: &str,
filepath: &str,
query: RepoGetRawFileOrLfsQuery,
- ) -> Result<(), ForgejoError> {
+ ) -> Result<Vec<u8>, ForgejoError> {
let request = self
.get(&format!("repos/{owner}/{repo}/media/{filepath}?{query}"))
.build()?;
let response = self.execute(request).await?;
match response.status().as_u16() {
- 200 => Ok(()),
+ 200 => Ok(response.bytes().await?[..].to_vec()),
_ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
}
}
@@ -5235,13 +5235,13 @@ impl crate::Forgejo {
repo: &str,
filepath: &str,
query: RepoGetRawFileQuery,
- ) -> Result<(), ForgejoError> {
+ ) -> Result<Vec<u8>, ForgejoError> {
let request = self
.get(&format!("repos/{owner}/{repo}/raw/{filepath}?{query}"))
.build()?;
let response = self.execute(request).await?;
match response.status().as_u16() {
- 200 => Ok(()),
+ 200 => Ok(response.bytes().await?[..].to_vec()),
_ => Err(ForgejoError::UnexpectedStatusCode(response.status())),
}
}
diff --git a/swagger.v1.json b/swagger.v1.json
index 36592ad..274063a 100644
--- a/swagger.v1.json
+++ b/swagger.v1.json
@@ -9112,6 +9112,7 @@
},
"/repos/{owner}/{repo}/media/{filepath}": {
"get": {
+ "produces": ["*/*"],
"tags": ["repository"],
"summary": "Get a file or it's LFS object from a repository",
"operationId": "repoGetRawFileOrLFS",
@@ -11172,7 +11173,7 @@
},
"/repos/{owner}/{repo}/raw/{filepath}": {
"get": {
- "produces": ["application/json"],
+ "produces": ["*/*"],
"tags": ["repository"],
"summary": "Get a file from a repository",
"operationId": "repoGetRawFile",