Skip to content

Commit c563e03

Browse files
committed
feat: do not unwrap() potentially None schema
1 parent ae3d077 commit c563e03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/oas3/src/spec/media_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl MediaType {
3333
pub fn schema(&self, spec: &Spec) -> Result<ObjectSchema, Error> {
3434
self.schema
3535
.as_ref()
36-
.unwrap()
36+
.ok_or(Error::Schema(super::SchemaError::NoSchema))?
3737
.resolve(spec)
3838
.map_err(Error::Ref)
3939
}

0 commit comments

Comments
 (0)