File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -191,19 +191,17 @@ impl CodesampleTemplates {
191191}
192192
193193pub async fn generate_codesamples (
194- openapi_spec : & str ,
194+ openapi_spec : & OpenApi ,
195195 templates : CodesampleTemplates ,
196196 excluded_operation_ids : BTreeSet < String > ,
197197 path_param_example : fn ( String ) -> String ,
198198) -> anyhow:: Result < BTreeMap < CodegenLanguage , Vec < CodeSample > > > {
199- let openapi_spec: OpenApi =
200- serde_json:: from_str ( openapi_spec) . context ( "failed to parse OpenAPI spec" ) ?;
201-
202199 let api_ir = crate :: api:: Api :: new (
203200 openapi_spec
204201 . paths
205- . expect ( "found no endpoints in input spec" ) ,
206- & mut openapi_spec. components . unwrap_or_default ( ) ,
202+ . clone ( )
203+ . context ( "found no endpoints in input spec" ) ?,
204+ & mut openapi_spec. components . clone ( ) . unwrap_or_default ( ) ,
207205 & [ ] ,
208206 crate :: IncludeMode :: OnlyPublic ,
209207 & excluded_operation_ids,
You can’t perform that action at this time.
0 commit comments