Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit e9119ec

Browse files
committed
1 parent 6abd369 commit e9119ec

File tree

8 files changed

+1096
-0
lines changed

8 files changed

+1096
-0
lines changed

src/oidcmsg/message.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ def _add_value(self, skey, vtyp, key, val, _deser, null_allowed):
338338
vtyp = vtyp[0]
339339

340340
if isinstance(vtyp, list):
341+
if val is None:
342+
if null_allowed:
343+
self._dict[key] = val
344+
return
345+
raise ValueError("Null is not allowed")
346+
341347
vtype = vtyp[0]
342348
if isinstance(val, vtype):
343349
if issubclass(vtype, Message):
@@ -824,6 +830,18 @@ def required_parameters(self):
824830
"""
825831
return [p for p, s in self.c_param.items() if s[1] is True]
826832

833+
def value_type(self, parameter):
834+
"""
835+
Return the type of value that a parameter can have.
836+
837+
:param parameter: Name of the parameter
838+
:return: Type of Value or None if unknown.
839+
"""
840+
_spec = self.c_param.get(parameter)
841+
if _spec:
842+
return _spec[0]
843+
844+
return None
827845

828846
# =============================================================================
829847

0 commit comments

Comments
 (0)