@@ -28,128 +28,179 @@ repository = "{{.}}"
2828documentation = "{ {.} }"
2929{ {/documentationUrl} }
3030{ {#homePageUrl} }
31- homepage = "{ {.} }
31+ homepage = "{ {.} }"
3232{ {/homePageUrl} }
3333
3434[features]
35- default = ["client", "server"]
35+ default = ["client", "server", "client-tls" ]
3636client = [
37- { {#apiUsesMultipart} }
38- "mime_0_2",
39- { {/apiUsesMultipart} }
4037{ {#apiUsesMultipartFormData} }
4138 "multipart", "multipart/client", "swagger/multipart_form",
4239{ {/apiUsesMultipartFormData} }
4340{ {#apiUsesMultipartRelated} }
44- "hyper_0_10 ", "mime_multipart ",
41+ "mime_multipart ", "swagger/multipart_related ",
4542{ {/apiUsesMultipartRelated} }
4643{ {#usesUrlEncodedForm} }
4744 "serde_urlencoded",
4845{ {/usesUrlEncodedForm} }
4946{ {#hasCallbacks} }
50- "serde_ignored", "regex", " percent-encoding", "lazy_static",
47+ "serde_ignored", "percent-encoding", { {^apiUsesByteArray } } "lazy_static", "regex", { {/apiUsesByteArray } }
5148{ {/hasCallbacks} }
5249{ {! Anything added to the list below, should probably be added to the callbacks list below } }
53- "hyper", "hyper-openssl", "hyper-tls", "native-tls", "openssl", "url"
50+ "hyper", "percent-encoding", "hyper-util/http1", "hyper-util/http2", "url"
51+ ]
52+ # TLS support - automatically selects backend based on target OS:
53+ # - macOS/Windows/iOS: native-tls via hyper-tls
54+ # - Other platforms: OpenSSL via hyper-openssl
55+ # Dependencies are in target-specific sections below
56+ client-tls = [
57+ "client",
58+ "dep:native-tls",
59+ "dep:hyper-tls",
60+ "dep:openssl",
61+ "dep:hyper-openssl",
62+ "swagger/tls"
5463]
5564server = [
56- { {#apiUsesMultipart} }
57- "mime_0_2",
58- { {/apiUsesMultipart} }
5965{ {#apiUsesMultipartFormData} }
6066 "multipart", "multipart/server", "swagger/multipart_form",
6167{ {/apiUsesMultipartFormData} }
6268{ {#apiUsesMultipartRelated} }
63- "hyper_0_10 ", "mime_multipart ",
69+ "mime_multipart ", "swagger/multipart_related ",
6470{ {/apiUsesMultipartRelated} }
6571{ {#hasCallbacks} }
66- "native-tls", " hyper-openssl ", "hyper-tls", "openssl ",
72+ "hyper-util/http1 ", "hyper-util/http2 ",
6773{ {/hasCallbacks} }
6874{ {! Anything added to the list below, should probably be added to the callbacks list above } }
69- "serde_ignored", "hyper", "regex", "percent-encoding", "url", "lazy_static"
75+ "serde_ignored", "hyper", "percent-encoding", "url",
76+ { {^apiUsesByteArray} }"lazy_static", "regex"{ {/apiUsesByteArray} }
77+ ]
78+ cli = [
79+ { {#apiHasDeleteMethods} }
80+ "dialoguer",
81+ { {/apiHasDeleteMethods} }
82+ "anyhow", "clap", "clap-verbosity-flag", "simple_logger", "tokio"
7083]
7184conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"]
7285
73- [target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "ios"))'.dependencies]
74- native-tls = { version = " 0.2" , optional = true }
75- hyper-tls = { version = " 0.5" , optional = true }
76-
77- [target.'cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))'.dependencies]
78- hyper-openssl = { version = " 0.9" , optional = true }
79- openssl = { version = " 0.10" , optional = true }
86+ mock = ["mockall"]
87+ validate = [{ {^apiUsesByteArray} }"regex",{ {/apiUsesByteArray} } "serde_valid", "swagger/serdevalid"]
8088
8189[dependencies]
8290# Common
83- async-trait = "0.1.24 "
91+ async-trait = "0.1.89 "
8492chrono = { version = " 0.4" , features = [" serde" ] }
8593futures = "0.3"
86- swagger = { version = " 6.1" , features = [" serdejson" , " server" , " client" , " tls" , " tcp" ] }
87- log = "0.4.0"
94+ swagger = { version = " 7.0.0" , features = [" serdejson" , " server" , " client" ] }
95+ headers = "0.4.1"
96+ log = "0.4.29"
97+
8898mime = "0.3"
99+ mockall = { version = " 0.14" , optional = true }
100+ { {#apiUsesByteArray} }
101+ lazy_static = "1.5"
102+ regex = "1.12"
103+ { {/apiUsesByteArray} }
104+
89105
90106serde = { version = " 1.0" , features = [" derive" ] }
91107serde_json = "1.0"
92- validator = { version = " 0.16" , features = [" derive" ] }
108+ { {#apiUsesIntegerEnums} }
109+ serde_repr = "0.1"
110+ { {/apiUsesIntegerEnums} }
111+ serde_valid = { version = " 2.0" , optional = true }
112+
113+ validator = { version = " 0.20" , features = [" derive" ] }
93114
94115# Crates included if required by the API definition
95116{ {#usesXml} }
96- # TODO: this should be updated to point at the official crate once
97- # https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream
98- serde-xml-rs = { git = " https://github.com/Metaswitch/serde-xml-rs" , branch = " master" }
117+ serde-xml-rs = "0.8"
99118{ {/usesXml} }
100- { {#apiUsesMultipart} }
101- mime_0_2 = { package = " mime" , version = " 0.2.6" , optional = true }
102- { {/apiUsesMultipart} }
103119{ {#apiUsesMultipartFormData} }
104- multipart = { version = " 0.16 " , default -features = false , optional = true }
120+ multipart = { version = " 0.18 " , default -features = false , optional = true }
105121{ {/apiUsesMultipartFormData} }
106122{ {#apiUsesUuid} }
107- uuid = { version = " 1.3.1 " , features = [" serde" , " v4" ]}
123+ uuid = { version = " 1.23.0 " , features = [" serde" , " v4" ]}
108124{ {/apiUsesUuid} }
109125
110126# Common between server and client features
111- hyper = { version = " 0.14" , features = [" full" ], optional = true }
127+ bytes = "1.11"
128+ http-body-util = "0.1.3"
129+ hyper = { version = " 1.9.0" , features = [" full" ], optional = true }
130+ hyper-util = { version = " 0.1.20" , features = [" service" ] }
112131{ {#apiUsesMultipartRelated} }
113- mime_multipart = { version = " 0.5" , optional = true }
114- hyper_0_10 = { package = " hyper" , version = " 0.10" , default -features = false , optional= true }
132+ mime_multipart = { version = " 0.10" , optional = true , package = " mime-multipart-hyper1" }
115133{ {/apiUsesMultipartRelated} }
116- serde_ignored = { version = " 0.1.1 " , optional = true }
117- url = { version = " 2.1 " , optional = true }
134+ serde_ignored = { version = " 0.1.14 " , optional = true }
135+ url = { version = " 2.5 " , optional = true }
118136
119137# Client-specific
120138{ {#usesUrlEncodedForm} }
121- serde_urlencoded = { version = " 0.6 .1" , optional = true }
139+ serde_urlencoded = { version = " 0.7 .1" , optional = true }
122140{ {/usesUrlEncodedForm} }
141+ tower-service = "0.3.3"
123142
124143# Server, and client callback-specific
125- lazy_static = { version = " 1.4" , optional = true }
126- percent-encoding = { version = " 2.1.0" , optional = true }
127- regex = { version = " 1.3" , optional = true }
144+ { {^apiUsesByteArray} }
145+ lazy_static = { version = " 1.5" , optional = true }
146+ regex = { version = " 1.12" , optional = true }
147+ { {/apiUsesByteArray} }
148+ percent-encoding = { version = " 2.3.2" , optional = true }
149+
150+ # CLI-specific
151+ anyhow = { version = " 1" , optional = true }
152+ clap = { version = " 4.6.0" , features = [" env" ], optional = true }
153+ clap-verbosity-flag = { version = " 3.0" , optional = true }
154+ simple_logger = { version = " 5.2.0" , features = [" stderr" ], optional = true }
155+ tokio = { version = " 1.50.0" , features = [" rt-multi-thread" , " macros" ], optional = true }
156+ { {#apiHasDeleteMethods} }
157+ dialoguer = { version = " 0.12" , optional = true }
158+ { {/apiHasDeleteMethods} }
128159
129160# Conversion
130- frunk = { version = " 0.3.0 " , optional = true }
131- frunk_derives = { version = " 0.3.0 " , optional = true }
132- frunk_core = { version = " 0.3.0 " , optional = true }
133- frunk-enum-derive = { version = " 0.2 .0" , optional = true }
134- frunk-enum-core = { version = " 0.2 .0" , optional = true }
161+ frunk = { version = " 0.4.4 " , optional = true }
162+ frunk_derives = { version = " 0.4.4 " , optional = true }
163+ frunk_core = { version = " 0.4.4 " , optional = true }
164+ frunk-enum-derive = { version = " 0.3 .0" , optional = true }
165+ frunk-enum-core = { version = " 0.3 .0" , optional = true }
135166
136- # Bearer authentication
137- jsonwebtoken = { version = " 9.3.0" , optional = false }
167+ # TLS dependencies - platform-specific backends
168+ # On macOS/Windows/iOS, use native-tls via hyper-tls
169+ [target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "ios"))'.dependencies]
170+ native-tls = { version = " 0.2" , optional = true }
171+ hyper-tls = { version = " 0.6" , optional = true }
172+
173+ # On other platforms (Linux, etc.), use OpenSSL via hyper-openssl
174+ [target.'cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))'.dependencies]
175+ openssl = { version = " 0.10" , optional = true }
176+ hyper-openssl = { version = " 0.10" , optional = true }
138177
139178[dev-dependencies]
140- clap = "2.25"
141- env_logger = "0.7"
142- tokio = { version = " 1.14" , features = [" full" ] }
179+ always_send = "0.1.1"
180+ clap = "4.6.0"
181+ env_logger = "0.11"
182+ tokio = { version = " 1.50.0" , features = [" full" ] }
143183native-tls = "0.2"
184+ pin-project = "1.1.11"
185+
186+ # Bearer authentication, used in examples
187+ jsonwebtoken = { version = " 10.3.0" , features = [" rust_crypto" ]}
144188
145189[target.'cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))'.dev-dependencies]
146- tokio-openssl = "0.6"
147190openssl = "0.10"
191+ tokio-openssl = "0.6"
148192
149193[[example]]
150- name = "client"
194+ name = "{ {{packageName} }}-client"
195+ path = "examples/client/main.rs"
151196required-features = ["client"]
152197
153198[[example]]
154- name = "server"
199+ name = "{ {{packageName} }}-server"
200+ path = "examples/server/main.rs"
155201required-features = ["server"]
202+
203+ [[bin]]
204+ name = "{ {{packageName} }}"
205+ path = "bin/cli.rs"
206+ required-features = ["client", "cli"]
0 commit comments