Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SCIMPLE-93] Set type=reference, when referenceTypes are set #425

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,15 @@ private static List<Schema.Attribute> createAttributes(String urn, List<Field> f
case STRING_TYPE_IDENTIFIER:
case CHARACTER_ARRAY_TYPE_IDENTIFIER:
case BIG_C_CHARACTER_ARRAY_TYPE_IDENTIFIER:
log.debug("Setting type to String");
attribute.setType(Schema.Attribute.Type.STRING);
case RESOURCE_REFERENCE_TYPE_IDENTIFIER:
// Check whether referenceTypes were not set. The default value is [""]
if (sa.referenceTypes().length == 1 && sa.referenceTypes()[0].isEmpty()) {
log.debug("Setting type to String");
attribute.setType(Schema.Attribute.Type.STRING);
} else {
log.debug("Setting type to reference");
attribute.setType(Schema.Attribute.Type.REFERENCE);
}
attributeIsAString = true;
break;
case INT_TYPE_IDENTIFIER:
Expand Down Expand Up @@ -235,10 +242,6 @@ private static List<Schema.Attribute> createAttributes(String urn, List<Field> f
log.debug("Setting type to date time");
attribute.setType(Schema.Attribute.Type.DATE_TIME);
break;
case RESOURCE_REFERENCE_TYPE_IDENTIFIER:
log.debug("Setting type to reference");
attribute.setType(Schema.Attribute.Type.REFERENCE);
break;
default:
log.debug("Setting type to complex");
attribute.setType(Schema.Attribute.Type.COMPLEX);
Expand Down