Fix checks of startIndex
and itemsPerPage
in ListResponse
#46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently on instantiation, the ListResponse class will check that the
startIndex
anditemsPerPage
properties are integer values greater than or equal to1
and0
respectively, and throw a TypeError if not. This was intended to prevent the use of invalid values in bespoke implementations. According to RFC7644,startIndex
anditemsPerPage
values less than this should be treated as being1
and0
respectively. This rounding is already implemented in the ListResponse constructor, but is functionally unused, as the constructor will throw the TypeError first.This change removes the minimum integer value check from the ListResponse constructor (fixes #42), and rounds
startIndex
andcount
integer constraints to their minimum values in theSCIMMY.Types.Resource
constructor. Test fixtures have also been updated to reflect this change, and will now check for more non-number values in place of non-positive integers.