Fix handling of schema extensions when filtering coerced values in SCIMMY.Types.SchemaDefinition
#38
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, filtering of included or excluded attributes by the
SchemaDefinition
type class before return does not correctly handle namespaced extension attributes. This is due to the double handling of extension schema filtering, and insufficient evaluation of overall filter structure. A specific example of this is evident when making a request for aUser
resource, extended with theEnterpriseUser
schema, and settingexcludedAttributes
to any attribute from theUser
schema.The internal filter method of the
SchemaDefinition
class has been rewritten to first capture all excluded and included attribute filters. If no explicit inclusions were specified, and all supplied filters are exclusions, all attributes and extensions not explicitly excluded will instead be included (fixes #37). Double handling of extension schema filtering has also been resolved, as inclusions and exclusions will only be evaluated when the filter condition is not for a namespaced attribute. Test fixtures for thecoerce
method of theSchemaDefinition
class have also been updated to verify attribute, extension, and namespaced attribute filtering is behaving as expected.