Toromyx / schema_org_types_rs

Schema.org schemas as Rust types
https://docs.rs/schema_org_types
2 stars 1 forks source link

Order variants in property schemas by specificity #3

Closed Toromyx closed 10 months ago

Toromyx commented 10 months ago

If a property can be an URL and a string, the current ordering causes serde to try to deserialize the data into a string first. This is successful even if it is a valid URL.

Toromyx commented 10 months ago

Property variants should be sorted like this:

  1. Classes
  2. Enumerations
  3. Datatypes
    1. URL
    2. Date
    3. Time
    4. DateTime
    5. Boolean
    6. Integer
    7. Number
    8. Text