commandline icon indicating copy to clipboard operation
commandline copied to clipboard

Throw invalid operation exception if Dictionary type is used for specification

Open phaniva opened this issue 2 years ago • 1 comments

To address Issue 377, I have added to list of existing specification gaurds.

phaniva avatar May 26 '23 01:05 phaniva

Hi Phani,

In my opinion the problem with this solution is that the error Non scalar properties should be sequence of type IEnumerable<T>. defined in TypeConverter.ChangeTypeSequence will be bypassed - that means that developers will receive a different error message when trying to parse a IEnumerable without a specified type.

In my opinion there are two possible solutions to the problem:

  1. To ensure - inside ChangeTypeSequence - that the sequence has exactly one generic argument.
  2. To add two new rules inside SpecificationGuards that ensure that sequence types have exactly one generic argument.

Is it fair to have some checks inside the ChangeTypeSequence and some checks inside SpecificationGuards? Shouldn't we maybe try to move all checks to SpecificationGuards?

Thanks in advance and kind regards, Davide

PentaPinguino avatar Jul 23 '23 13:07 PentaPinguino