{"action":"opened","issue":{"url":"https://api.github.com/repos/odpi/egeria/issues/215","repository_url":"https://api.github.com/repos/odpi/egeria","labels_url":"https://api.github.com/repos/odpi/egeria/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/odpi/egeria/issues/215/comments","events_url":"https://api.github.com/repos/odpi/egeria/issues/215/events","html_url":"https://github.com/odpi/egeria/issues/215","id":362565963,"node_id":"MDU6SXNzdWUzNjI1NjU5NjM=","number":215,"title":"OMRS: Improve exception when incorrect classification name passed on addEntity","user":{"login":"planetf1","id":7292002,"node_id":"MDQ6VXNlcjcyOTIwMDI=","avatar_url":"https://avatars3.githubusercontent.com/u/7292002?v=4","gravatar_id":"","url":"https://api.github.com/users/planetf1","html_url":"https://github.com/planetf1","followers_url":"https://api.github.com/users/planetf1/followers","following_url":"https://api.github.com/users/planetf1/following{/other_user}","gists_url":"https://api.github.com/users/planetf1/gists{/gist_id}","starred_url":"https://api.github.com/users/planetf1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetf1/subscriptions","organizations_url":"https://api.github.com/users/planetf1/orgs","repos_url":"https://api.github.com/users/planetf1/repos","events_url":"https://api.github.com/users/planetf1/events{/privacy}","received_events_url":"https://api.github.com/users/planetf1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-21T11:04:59Z","updated_at":"2018-09-21T11:04:59Z","closed_at":null,"author_association":"MEMBER","body":"When trying to create a new entity through the OMRS REST API addEntity operation, if an incorrect classification such as:\r\n\r\n```\r\n  \"initialClassifications\": [\r\n    {\r\n      \"class\": \"Classification\",\r\n      \"name\": \"confidentiality\"\r\n    }\r\n```\r\n\r\nis passed (since the correct name of the classification is 'Confidentiality' - ie with an upper case C ....\r\n\r\nthen the returned response is:\r\n\r\n```\r\n{\r\n    \"timestamp\": \"2018-09-21T10:58:23.420+0000\",\r\n    \"status\": 500,\r\n    \"error\": \"Internal Server Error\",\r\n    \"message\": \"OMRS-LOCAL-REPOSITORY-503-007 An OMRS repository connector myserver has passed an invalid parameter to the repository content manager isValidClassificationForEntity operation as part of the addEntity request\",\r\n    \"path\": \"/open-metadata/repository-services/users/me/instances/entity\"\r\n}\r\n```\r\n\r\nThe check occurs in isValidTypeCategory (OMRSRepositoryContentManager)\r\n`        TypeDef   typeDef = knownTypeDefNames.get(typeName);\r\n`\r\nwhich shows the correct entry is\r\n`\"Confidentiality\" -> \"ClassificationDef{validEntityDefs=[EntityDef{superType=null, description='An open metadata entity that has a unique identifier.', descriptionGUID='null', origin='bce3b0a0-662a-4f87-b8dc-844078a11a6e', createdBy='ODPi Egeria (OMRS)', updatedBy='null', createTime=Thu Jan 18 22:04:00 GMT 2018, updateTime=null, options=null, externalStandardMappings=null, validInstanceStatusList=[InstanceStatus{ordinal=15, name='Active', description='The instance is approved and in use.'}, InstanceStatus{ordinal=99, name='Deleted', description='The instance has been deleted and is no longer available.'}], initialStatus=InstanceStatus{ordinal=15, name='Active', description='The instance is approved and in use.'}, propertiesDefinition=[TypeDefAttribute{attributeName='qualifiedName', attributeType=PrimitiveDef{primitiveDefCategory=PrimitiveDefCategory{code=11, name='string', javaClassName='java.lang.String', guid='b34a64b9-554a-42b1-8f8a-7d5c2339f9c4'}, category=AttributeTypeDefCategory{typeCode=1, typeName='Primi\"`\r\n\r\nSince specifying an incorrect classification isn't that uncommon I would guess, I think a more unique exception would be helpful to allow the user to correct the request\r\n\r\nNot checked what is returned from the client API.\r\n\r\nNote that once the 'C' is corrected, this code then validates the classification correctly."}}
{"actor":{"display_login":"planetf1"}}