summaryrefslogtreecommitdiffstats
path: root/generator/src/openapi.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-01-11 04:45:59 +0100
committerCyborus <cyborus@cyborus.xyz>2024-01-11 04:48:59 +0100
commitb98426f90783a8c3976f0eddcd882ff8caae9d44 (patch)
treee9cf64c32b71141954017e4b70f7f6d4645ec8a9 /generator/src/openapi.rs
parentformat (diff)
downloadforgejo-api-b98426f90783a8c3976f0eddcd882ff8caae9d44.tar.xz
forgejo-api-b98426f90783a8c3976f0eddcd882ff8caae9d44.zip
strongly type `Parameter.in`
Diffstat (limited to '')
-rw-r--r--generator/src/openapi.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/generator/src/openapi.rs b/generator/src/openapi.rs
index 3301edb..0540688 100644
--- a/generator/src/openapi.rs
+++ b/generator/src/openapi.rs
@@ -92,7 +92,7 @@ pub struct ExternalDocs {
pub struct Parameter {
pub name: String,
#[serde(rename = "in")]
- pub _in: String,
+ pub _in: ParameterIn,
pub description: Option<String>,
pub required: Option<bool>,
pub schema: Option<MaybeRef<Schema>>,
@@ -120,6 +120,16 @@ pub struct Parameter {
#[derive(serde::Deserialize, Debug, PartialEq)]
#[serde(rename_all(deserialize = "camelCase"))]
+pub enum ParameterIn {
+ Path,
+ Query,
+ Header,
+ Body,
+ FormData,
+}
+
+#[derive(serde::Deserialize, Debug, PartialEq)]
+#[serde(rename_all(deserialize = "camelCase"))]
pub enum ParameterType {
String,
Number,