Skip to content

Commit 4eb7a35

Browse files
broosk1993kaplaneladNexVeridian
authored
Resolves #26 (#27)
* Resolves #26 * Update src/utils.rs Co-authored-by: Elijah McMorris <NexVeridian@gmail.com> --------- Co-authored-by: Elad Kaplan <kaplan.elad@gmail.com> Co-authored-by: Elijah McMorris <NexVeridian@gmail.com>
1 parent de3dad9 commit 4eb7a35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ pub async fn openapi_spec_json() -> Result<Response> {
3333
/// Currently this function doesn't return any error. this is for feature
3434
/// functionality
3535
pub async fn openapi_spec_yaml() -> Result<Response> {
36-
format::yaml(&get_openapi_spec().to_yaml()?)
36+
let yaml = get_openapi_spec()
37+
.to_yaml()
38+
.map_err(|e| loco_rs::Error::Any(Box::new(e)))?;
39+
format::yaml(&yaml)
3740
}
3841

3942
/// Adds the `OpenAPI` endpoints the app router

0 commit comments

Comments
 (0)