@@ -17,7 +17,15 @@ use quote::{format_ident, quote};
17
17
// NOTE: this is only "pub" for the `cargo doc` link on [`lookup_resource!`].
18
18
#[ derive( serde:: Deserialize ) ]
19
19
pub struct Input {
20
- /// Name of the resource (PascalCase)
20
+ /// Name of the resource
21
+ ///
22
+ /// This is taken as the name of the database model type in
23
+ /// `omicron_nexus::db::model`, the name of the authz type in
24
+ /// `omicron_nexus::authz`, and will be the name of the new type created by
25
+ /// this macro. The snake case version of the name is taken as the name of
26
+ /// the Diesel table interface in `db::schema`.
27
+ ///
28
+ /// This value is typically PascalCase (e.g., "Organization").
21
29
name : String ,
22
30
/// ordered list of resources that are ancestors of this resource, starting
23
31
/// with the top of the hierarchy
@@ -77,8 +85,8 @@ pub struct Config {
77
85
path_authz_names : Vec < syn:: Ident > ,
78
86
79
87
// Child resources
80
- /// list of names of child resources (PascalCase, raw input to the macro)
81
- /// (e.g., [`Instance`, `Disk`] )
88
+ /// list of names of child resources, in the same form and with the same
89
+ /// assumptions as [`Input::name`] (i.e., typically PascalCase )
82
90
child_resources : Vec < String > ,
83
91
84
92
// Parent resource, if any
@@ -118,6 +126,8 @@ impl Config {
118
126
/// ancestor in its path)
119
127
struct Resource {
120
128
/// PascalCase resource name itself (e.g., `Project`)
129
+ ///
130
+ /// See [`Input::name`] for more on the assumptions and how it's used.
121
131
name : syn:: Ident ,
122
132
/// snake_case resource name (e.g., `project`)
123
133
name_as_snake : String ,
0 commit comments