Skip to content

Commit

Permalink
Parse content types when MetaData nodes are in the html
Browse files Browse the repository at this point in the history
  • Loading branch information
ccouzens committed Jul 16, 2020
1 parent b63b5ce commit d6e538f
Show file tree
Hide file tree
Showing 9 changed files with 1,860 additions and 243 deletions.
2 changes: 1 addition & 1 deletion transformer/src/parsers/doc/detail_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl<'a> TryFrom<&scraper::ElementRef<'a>> for DefinitionListValue {
type Error = DefinitionListValueFromElError;

fn try_from(el: &scraper::ElementRef) -> Result<Self, Self::Error> {
let top_selector = scraper::Selector::parse(":scope > dl, :scope > a")
let top_selector = scraper::Selector::parse(":scope > dl, :scope > MetadataType > dl")
.map_err(|e| Self::Error::SelectorParseError(format!("{:?}", e)))?;
let child = el.select(&top_selector).next();
match (child, child.map(|c| c.value().name())) {
Expand Down
22 changes: 11 additions & 11 deletions transformer/src/parsers/doc/etc/object_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,16 @@ fn removed_field_test() {
assert_eq!(
serde_json::to_value(value).unwrap(),
json!({
"title": "test_BaseType",
"description": "A base abstract type for all the types.",
"type": "object",
"properties": {
"fieldB": {
"description": "A field that has not been removed",
"type": "string"
}
},
"additionalProperties": false
})
"title": "test_BaseType",
"description": "A base abstract type for all the types.",
"type": "object",
"properties": {
"fieldB": {
"description": "A field that has not been removed",
"type": "string"
}
},
"additionalProperties": false
})
);
}
Loading

0 comments on commit d6e538f

Please sign in to comment.