Skip to content

Commit

Permalink
Fix(SCIMMY.Types.Attribute): throw missing required value error for b…
Browse files Browse the repository at this point in the history
…idirectional attributes
  • Loading branch information
sleelin committed Nov 15, 2023
1 parent 41db817 commit 8f2fd81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/types/attribute.js
Original file line number Diff line number Diff line change
@@ -416,7 +416,7 @@ export class Attribute {
const {required, multiValued, canonicalValues} = this.config;

// If the attribute is required, make sure it has a value
if ((source === undefined || source === null) && required && this.config.direction === direction)
if ((source === undefined || source === null) && required && (direction !== "both" || this.config.direction === direction))
throw new TypeError(`Required attribute '${this.name}' is missing`);
// If the attribute is multi-valued, make sure its value is a collection
if (source !== undefined && !isComplexMultiValue && multiValued && !Array.isArray(source))

0 comments on commit 8f2fd81

Please sign in to comment.