spin_manifest/schema/v2/app_details.rs
1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use super::{Map, TargetEnvironmentRef, json_schema};
5
6/// App details
7#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)]
8#[serde(deny_unknown_fields)]
9pub struct AppDetails {
10 /// The name of the application.
11 ///
12 /// Example: `name = "my-app"`
13 pub name: String,
14 /// The application version. This should be a valid semver version.
15 ///
16 /// Example: `version = "1.0.0"`
17 #[serde(default, skip_serializing_if = "String::is_empty")]
18 pub version: String,
19 /// A human-readable description of the application.
20 ///
21 /// Example: `description = "App description"`
22 #[serde(default, skip_serializing_if = "String::is_empty")]
23 pub description: String,
24 /// The author(s) of the application.
25 ///
26 /// `authors = ["author@example.com"]`
27 #[serde(default, skip_serializing_if = "Vec::is_empty")]
28 pub authors: Vec<String>,
29 /// The Spin environments with which application components must be compatible
30 /// unless otherwise specified. Individual components may express different
31 /// requirements: these override the application-level default.
32 ///
33 /// Example: `targets = ["spin-up:3.3", "spinkube:0.4"]`
34 #[serde(default, skip_serializing_if = "Vec::is_empty")]
35 pub targets: Vec<TargetEnvironmentRef>,
36 /// Application-level settings for the trigger types used in the application.
37 /// The possible values are trigger type-specific.
38 ///
39 /// Example:
40 ///
41 /// ```ignore
42 /// [application.triggers.redis]
43 /// address = "redis://notifications.example.com:6379"
44 /// ```
45 ///
46 /// Learn more (Redis example): https://spinframework.dev/redis-trigger#setting-a-default-server
47 #[serde(rename = "trigger", default, skip_serializing_if = "Map::is_empty")]
48 #[schemars(schema_with = "json_schema::map_of_toml_tables")]
49 pub trigger_global_configs: Map<String, toml::Table>,
50 /// Settings for custom tools or plugins. Spin ignores this field.
51 #[serde(default, skip_serializing_if = "Map::is_empty")]
52 #[schemars(schema_with = "json_schema::map_of_toml_tables")]
53 pub tool: Map<String, toml::Table>,
54}