diff options
Diffstat (limited to 'src/types.rs')
-rw-r--r-- | src/types.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/types.rs b/src/types.rs index 1cd1b57..4099714 100644 --- a/src/types.rs +++ b/src/types.rs | |||
@@ -1,4 +1,5 @@ | |||
1 | use serde_derive::{Deserialize, Serialize}; | 1 | use serde_derive::{Deserialize, Serialize}; |
2 | use serde_json::{Map, Value}; | ||
2 | use thiserror::Error; | 3 | use thiserror::Error; |
3 | 4 | ||
4 | use std::collections::BTreeMap; | 5 | use std::collections::BTreeMap; |
@@ -8,13 +9,15 @@ use std::str::FromStr; | |||
8 | // Maybe use the builder pattern? | 9 | // Maybe use the builder pattern? |
9 | 10 | ||
10 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | 11 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] |
12 | #[serde(rename_all = "kebab-case")] | ||
11 | #[non_exhaustive] | 13 | #[non_exhaustive] |
12 | pub struct Poseidoc { | 14 | pub struct Poseidoc { |
13 | pub config: toml::Value, | 15 | pub config: toml::Value, |
14 | pub entities: BTreeMap<String, Entity>, | 16 | pub entities: BTreeMap<String, Entity>, |
15 | } | 17 | } |
16 | 18 | ||
17 | #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] | 19 | #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] |
20 | #[serde(rename_all = "kebab-case")] | ||
18 | #[non_exhaustive] | 21 | #[non_exhaustive] |
19 | pub struct Entity { | 22 | pub struct Entity { |
20 | pub name: String, | 23 | pub name: String, |
@@ -23,6 +26,7 @@ pub struct Entity { | |||
23 | pub kind: EntityKind, | 26 | pub kind: EntityKind, |
24 | pub brief_description: String, | 27 | pub brief_description: String, |
25 | pub documentation: String, | 28 | pub documentation: String, |
29 | pub properties: Map<String, Value>, | ||
26 | pub children: Children, | 30 | pub children: Children, |
27 | } | 31 | } |
28 | 32 | ||
@@ -79,7 +83,6 @@ pub struct LanguageParseError(()); | |||
79 | #[serde(transparent)] | 83 | #[serde(transparent)] |
80 | pub struct EntityKind(pub String); | 84 | pub struct EntityKind(pub String); |
81 | 85 | ||
82 | |||
83 | /// Plural version of EntityKind | 86 | /// Plural version of EntityKind |
84 | #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] | 87 | #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] |
85 | #[serde(transparent)] | 88 | #[serde(transparent)] |