Skip to content

Commit

Permalink
imp - doc - Allow all types in IANA and X- props
Browse files Browse the repository at this point in the history
---

We've finally allowed all types in IANA and X- props.

---

Type: imp
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 3, 2024
1 parent a6e8b95 commit ab476b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions VisualCard.Calendar/Parsers/VCalendarParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ public Parts.Calendar Parse()
{
string elementTypeUpper = elementType.ToUpper();
if (!extraAllowedTypes.Contains(elementTypeUpper) && !elementTypeUpper.StartsWith("X-"))
{
if (type == PartType.PartsArray && ((CalendarPartsArrayEnum)enumeration == CalendarPartsArrayEnum.IanaNames || (CalendarPartsArrayEnum)enumeration == CalendarPartsArrayEnum.NonstandardNames))
continue;
throw new InvalidDataException($"Part info type {classType?.Name ?? "<null>"} doesn't support property type {elementTypeUpper} because the following types are supported: [{string.Join(", ", extraAllowedTypes)}]");
}
}

// Handle the part type, and extract the value
Expand Down
4 changes: 4 additions & 0 deletions VisualCard/Parsers/VcardParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public Card Parse()
{
string elementTypeUpper = elementType.ToUpper();
if (!allowedTypes.Contains(elementTypeUpper) && !extraAllowedTypes.Contains(elementTypeUpper) && !elementTypeUpper.StartsWith("X-"))
{
if (type == PartType.PartsArray && ((PartsArrayEnum)enumeration == PartsArrayEnum.IanaNames || (PartsArrayEnum)enumeration == PartsArrayEnum.NonstandardNames))
continue;
throw new InvalidDataException($"Part info type {classType?.Name ?? "<null>"} doesn't support property type {elementTypeUpper} because the following base types are supported: [{string.Join(", ", allowedTypes)}] and the extra types are supported: [{string.Join(", ", extraAllowedTypes)}]");
}
}

// Handle the part type
Expand Down

0 comments on commit ab476b4

Please sign in to comment.