Skip to content

Commit

Permalink
fix unwrap properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtbuilds committed Apr 28, 2024
1 parent 6c21d84 commit 4fd8ed6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/extractor/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn effective_length(all_of: &[ReferenceOr<Schema>]) -> usize {
length += schema_ref.as_ref_str().map(|_s| 1).unwrap_or_default();
length += schema_ref
.as_item()
.map(|s| s.properties())
.and_then(|s| s.get_properties())
.map(|s| s.iter().len())
.unwrap_or_default();
}
Expand Down Expand Up @@ -181,7 +181,9 @@ fn extract_all_of(
fields.insert(name, field);
}
ReferenceOr::Item(item) => {
let props = item.properties();
let Some(props) = item.get_properties() else {
continue;
};
for (name, schema) in props {
let mut field = create_field(schema, spec);
if !field.ty.is_iterable() && !item.required().iter().any(|s| s == name) {
Expand Down

0 comments on commit 4fd8ed6

Please sign in to comment.