-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod legacy; | ||
mod new_oas; | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] | ||
pub struct Info { | ||
pub title: String, | ||
pub description: Option<String>, | ||
#[serde(rename = "termsOfService")] | ||
pub tos: Option<String>, | ||
pub contact: Option<Contact>, | ||
pub license: Option<License>, | ||
pub version: String, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] | ||
pub struct Contact { | ||
pub name: Option<String>, | ||
pub url: Option<String>, | ||
pub email: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] | ||
pub struct License { | ||
pub name: String, | ||
pub url: Option<String>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod info; | ||
mod server; | ||
mod paths; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use std::collections::HashMap; | ||
use serde_json::Value; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Default)] | ||
pub struct Paths { | ||
#[serde(flatten)] | ||
pub paths: HashMap<String, PathItem>, | ||
#[serde(flatten)] | ||
pub extensions: HashMap<String, Value>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use std::collections::HashMap; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] | ||
pub struct Server { | ||
#[serde(rename(deserialize = "url"))] | ||
pub base_url: String, | ||
pub description: Option<String>, | ||
pub variables: Option<HashMap<String, ServerVariable>>, | ||
} | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)] | ||
pub struct ServerVariable { | ||
#[serde(rename = "enum")] | ||
pub var_enum: Option<Vec<String>>, | ||
pub default: String, | ||
pub description: Option<String>, | ||
} | ||
|