From 8b98d81fc6853b0f5a40a6841d57e4e208448470 Mon Sep 17 00:00:00 2001 From: razmag <46993372+RazMag@users.noreply.github.com> Date: Mon, 6 Nov 2023 12:46:00 +0000 Subject: [PATCH] More work on "Paths" --- cherrybomb-oas/src/new_oas/paths.rs | 60 ++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/cherrybomb-oas/src/new_oas/paths.rs b/cherrybomb-oas/src/new_oas/paths.rs index f0b9ebb..f765b9b 100644 --- a/cherrybomb-oas/src/new_oas/paths.rs +++ b/cherrybomb-oas/src/new_oas/paths.rs @@ -12,7 +12,6 @@ pub struct Paths { #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PathItem { - pub item_ref: Option, pub summary: Option, pub description: Option, pub get: Option, @@ -24,16 +23,65 @@ pub struct PathItem { pub patch: Option, pub trace: Option, pub servers: Option>, - pub parameters: Option>, } -enum ParamRef { - Ref(RelReference), - Param(Parameter), +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct Operation { + pub tags: Option>, + pub summary: Option, + pub description: Option, + #[serde(rename = "externalDocs")] + pub external_docs: Option, + #[serde(rename = "operationId")] + pub operation_id: Option, + pub parameters: Option>, + #[serde(rename = "requestBody")] + pub request_body: Option, + pub responses: Option, + pub callbacks: Option>, + pub deprecated: Option, + pub security: Option>, + pub servers: Option>, } -pub struct Operation { +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct ExternalDocs { + pub description: Option, + pub url: String, +} +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct Parameter{ + pub name: String, + #[serde(rename = "in")] + pub in_: String, + pub description: Option, + pub required: Option, + pub deprecated: Option, + #[serde(rename = "allowEmptyValue")] + pub allow_empty_value: Option, + pub style: Option, + pub explode: Option, + #[serde(rename = "allowReserved")] + pub allow_reserved: Option, + pub schema: Option, + pub example: Option, + pub examples: Option>, + pub content: Option>, } +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct Responses { + #[serde(rename = "default")] + pub default: Option, + pub responses: Option>, + pub extensions: Option>, +} +#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] +pub struct Response { + pub description: String, + pub headers: Option>, + pub content: Option>, + pub links: Option>, +} \ No newline at end of file