Skip to content

Commit

Permalink
Treat XPathType and CssSelectorType as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
RehanSaeed committed Apr 23, 2019
1 parent 200d4fd commit 336cc6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Source/Schema.NET.Tool/Services/SchemaService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ private static string GetCSharpTypeString(string propertyName, string typeName,
case "Distance":
case "Energy":
case "Mass":
case "XPathType":
case "CssSelectorType":
return "string";
case "Time":
case "Duration":
Expand Down
4 changes: 2 additions & 2 deletions Source/Schema.NET/core/SpeakableSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public partial class SpeakableSpecification : Intangible
/// </summary>
[DataMember(Name = "cssSelector", Order = 206)]
[JsonConverter(typeof(ValuesConverter))]
public OneOrMany<CssSelectorType>? CssSelector { get; set; }
public OneOrMany<string>? CssSelector { get; set; }

/// <summary>
/// An XPath, e.g. of a &lt;a class="localLink" href="http://schema.org/SpeakableSpecification"&gt;SpeakableSpecification&lt;/a&gt; or &lt;a class="localLink" href="http://schema.org/WebPageElement"&gt;WebPageElement&lt;/a&gt;. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".
/// </summary>
[DataMember(Name = "xpath", Order = 207)]
[JsonConverter(typeof(ValuesConverter))]
public OneOrMany<XPathType>? Xpath { get; set; }
public OneOrMany<string>? Xpath { get; set; }
}
}
4 changes: 2 additions & 2 deletions Source/Schema.NET/core/WebPageElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ public partial class WebPageElement : CreativeWork
/// </summary>
[DataMember(Name = "cssSelector", Order = 206)]
[JsonConverter(typeof(ValuesConverter))]
public OneOrMany<CssSelectorType>? CssSelector { get; set; }
public OneOrMany<string>? CssSelector { get; set; }

/// <summary>
/// An XPath, e.g. of a &lt;a class="localLink" href="http://schema.org/SpeakableSpecification"&gt;SpeakableSpecification&lt;/a&gt; or &lt;a class="localLink" href="http://schema.org/WebPageElement"&gt;WebPageElement&lt;/a&gt;. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".
/// </summary>
[DataMember(Name = "xpath", Order = 207)]
[JsonConverter(typeof(ValuesConverter))]
public OneOrMany<XPathType>? Xpath { get; set; }
public OneOrMany<string>? Xpath { get; set; }
}
}

0 comments on commit 336cc6a

Please sign in to comment.