Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions news/656.feature.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Added the ``SCHEMA`` property parameter from :rfc:`9073#section-5.2`
(Event Publishing Extensions to iCalendar). It is defined in
``icalendar.param`` but not yet attached to a property class, since it
belongs on ``STRUCTURED-DATA``, which is not implemented yet. See
:issue:`656`.
16 changes: 16 additions & 0 deletions src/icalendar/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,21 @@ def _default() -> bool:
- :attr:`Todo.attendees <icalendar.cal.todo.Todo.attendees>`
"""

SCHEMA = string_parameter(
"SCHEMA",
"""Identify the schema that a STRUCTURED-DATA value conforms to.

Conformance:
This property parameter is specified in :rfc:`9073#section-5.2`.

This parameter SHOULD be specified on the STRUCTURED-DATA property.
Its value is a URI identifying the schema the structured data
follows. It supplements the media type given by the FMTTYPE
parameter, which alone may not be specific enough to interpret the
value (for example, which JSON-LD vocabulary a payload uses).
""",
)

SENT_BY = string_parameter(
"SENT-BY",
"""Specify the calendar user that is acting on behalf of the calendar user specified by the property.
Expand Down Expand Up @@ -858,6 +873,7 @@ def _del_GAP(prop): # noqa: N802
"RELATED",
"ROLE",
"RSVP",
"SCHEMA",
"SENT_BY",
"TZID",
"VALUE",
Expand Down
22 changes: 22 additions & 0 deletions src/icalendar/tests/prop/test_schema_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
r"""SCHEMA property parameter from :rfc:`9073`.

:rfc:`9073#section-5.2` defines SCHEMA as a URI identifying the schema a
``STRUCTURED-DATA`` property value conforms to. ``STRUCTURED-DATA``
(:rfc:`9073#section-6.6`) is not implemented in this codebase yet (see
:issue:`656`), so SCHEMA is only defined in :mod:`icalendar.param` for now
and not attached to any property class. It is exercised here directly
against ``Parameters``.
"""

from icalendar.parser import Parameters


def test_schema_is_a_plain_parameter_not_yet_attached_to_a_property():
"""SCHEMA exists in icalendar.param but has no property class yet.

STRUCTURED-DATA, the property SCHEMA belongs on, is not implemented
(see :issue:`656`), so SCHEMA is only reachable through raw
``Parameters`` for now.
"""
params = Parameters(SCHEMA="https://schema.org/FlightReservation")
assert params["SCHEMA"] == "https://schema.org/FlightReservation"