primitiveOrNull

This value as a scalar, or null if it is an array, an object or ProblemNull.

Combined with extensions[name]?., this collapses three different situations into the same null: an absent member, an explicit JSON null, and a wrong type. Use name in problem.extensions to tell absence apart from the other two.