diff options
author | Cyborus <cyborus@noreply.codeberg.org> | 2024-04-26 20:32:27 +0200 |
---|---|---|
committer | Cyborus <cyborus@noreply.codeberg.org> | 2024-04-26 20:32:27 +0200 |
commit | e58237e9ff6300e9b3d11edb29bc3309d06eca3a (patch) | |
tree | 45ef4308611ad3d72f5b7c763ea7161523e82499 | |
parent | Merge pull request 'format swagger file' (#49) from fmt-swagger into main (diff) | |
parent | update tests to use `CreateHookOptionConfig` fields (diff) | |
download | forgejo-api-e58237e9ff6300e9b3d11edb29bc3309d06eca3a.tar.xz forgejo-api-e58237e9ff6300e9b3d11edb29bc3309d06eca3a.zip |
Merge pull request 'add `CreateHookOptionConfig` required properties as fields' (#50) from hook-config-required-fields into main
Reviewed-on: https://codeberg.org/Cyborus/forgejo-api/pulls/50
-rw-r--r-- | src/generated/structs.rs | 2 | ||||
-rw-r--r-- | swagger.v1.json | 9 | ||||
-rw-r--r-- | tests/ci_test.rs | 10 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/generated/structs.rs b/src/generated/structs.rs index bcb8682..cda1845 100644 --- a/src/generated/structs.rs +++ b/src/generated/structs.rs @@ -500,6 +500,8 @@ pub enum CreateHookOptionType { /// required are "content_type" and "url" Required #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct CreateHookOptionConfig { + pub content_type: String, + pub url: url::Url, #[serde(flatten)] pub additional: BTreeMap<String, String>, } diff --git a/swagger.v1.json b/swagger.v1.json index ae371d0..052fafe 100644 --- a/swagger.v1.json +++ b/swagger.v1.json @@ -16942,9 +16942,18 @@ "CreateHookOptionConfig": { "description": "CreateHookOptionConfig has all config options in it\nrequired are \"content_type\" and \"url\" Required", "type": "object", + "required": ["content_type", "url"], "additionalProperties": { "type": "string" }, + "properties": { + "content_type": { + "type": "string" + }, + "url": { + "type": "string" + } + }, "x-go-package": "code.gitea.io/gitea/modules/structs" }, "CreateIssueCommentOption": { diff --git a/tests/ci_test.rs b/tests/ci_test.rs index 925dc2e..0d03074 100644 --- a/tests/ci_test.rs +++ b/tests/ci_test.rs @@ -403,13 +403,9 @@ async fn admin() { authorization_header: None, branch_filter: None, config: CreateHookOptionConfig { - // content_type: "json".into(), - // url: url::Url::parse("http://test.local/").unwrap(), - additional: [ - ("content_type".into(), "json".into()), - ("url".into(), "http://test.local/".into()), - ] - .into(), + content_type: "json".into(), + url: url::Url::parse("http://test.local/").unwrap(), + additional: Default::default(), }, events: Some(Vec::new()), r#type: CreateHookOptionType::Gitea, |