Comments (6)
What is the request body sent?
from egeria.
Adding the body below in my editor right now - it's pulled from swagger. It's clearly invalid, but being unclear as to what was required I was going to step through the validation checks with the debugger to understand how the code worked.
It also affects create relationship & create entity proxy. It's something to do with jackson/spring serialization/deserialization I think, and the way class mapping is done.
{
"entityTypeGUID": "string",
"initialClassifications": [
{
"createTime": "2018-09-17T14:48:22.537Z",
"createdBy": "string",
"status": "InstanceStatus{ordinal=0, name='<Unknown>', description='Unknown instance status.'}",
"statusOnDelete": "InstanceStatus{ordinal=0, name='<Unknown>', description='Unknown instance status.'}",
"type": {
"typeDefCategory": "TypeDefCategory{typeCode=0, typeName='<Unknown>', typeDescription='Uninitialized TypeDef object.'}",
"typeDefDescription": "string",
"typeDefDescriptionGUID": "string",
"typeDefGUID": "string",
"typeDefName": "string",
"typeDefSuperTypes": [
{
"guid": "string",
"name": "string"
}
],
"typeDefVersion": 0,
"validInstanceProperties": [
"string"
],
"validStatusList": [
"InstanceStatus{ordinal=0, name='<Unknown>', description='Unknown instance status.'}"
]
},
"updateTime": "2018-09-17T14:48:22.537Z",
"updatedBy": "string",
"version": 0,
"classificationName": "string",
"systemAttributes": {
"createTime": "2018-09-17T14:48:22.537Z",
"createdBy": "string",
"guid": "string",
"status": "ACTIVE",
"updateTime": "2018-09-17T14:48:22.537Z",
"updatedBy": "string",
"version": 0
}
}
],
"initialProperties": {
"effectiveFromTime": "2018-09-17T14:48:22.537Z",
"effectiveToTime": "2018-09-17T14:48:22.537Z",
"instanceProperties": {},
"propertyCount": 0,
"propertyNames": {}
},
"initialStatus": "InstanceStatus{ordinal=0, name='<Unknown>', description='Unknown instance status.'}"
}
from egeria.
You are right, this request body is incorrect - it does not have the class information for the request body in it. Our JSON should look like this ... this is a GET response for an entity ... notice it begins with the "class" tag - this is required to allow Jackson to process subclasses:
{
"class": "EntityDetailResponse",
"relatedHTTPCode": 200,
"entity": {
"class": "EntityDetail",
"type": {
"class": "InstanceType",
"typeDefCategory": "ENTITY_DEF",
"typeDefGUID": "578a3510-9ad3-45fe-8ada-e4e9572c37c8",
"typeDefName": "GovernanceOfficer",
"typeDefVersion": 1,
"typeDefDescription": "Person responsible for a governance domain.",
"typeDefSuperTypes": [
{
"guid": "a32316b8-dc8c-48c5-b12b-71c1b2a080bf",
"name": "Referenceable"
}
],
"validInstanceProperties": [
"qualifiedName",
"additionalProperties",
"title",
"scope",
"domain"
]
},
"createdBy": "julesk",
"createTime": "2018-09-11T13:01:20.139+0000",
"version": 1,
"instanceProvenanceType": "LOCAL_COHORT",
"metadataCollectionId": "87b06ffe-9db2-4ef5-ba6e-8127480cf30d",
"guid": "fd7d41e7-70f5-42ec-86d3-88683e599494",
"instanceURL": "http://localhost:8080/instances/entity/fd7d41e7-70f5-42ec-86d388683e599494",
"properties": {
"class": "InstanceProperties",
"instanceProperties": {
"title": {
"class": "PrimitivePropertyValue",
"instancePropertyCategory": "PRIMITIVE",
"primitiveDefCategory": "OM_PRIMITIVE_TYPE_STRING",
"primitiveValue": "Chief Data Officer (CDO)"
},
"qualifiedName": {
"class": "PrimitivePropertyValue",
"instancePropertyCategory": "PRIMITIVE",
"primitiveDefCategory": "OM_PRIMITIVE_TYPE_STRING",
"primitiveValue": "EXEC-CDO"
},
"domain": {
"class": "EnumPropertyValue",
"instancePropertyCategory": "ENUM",
"ordinal": 1,
"symbolicName": "Data",
"description": "The data (information) governance domain."
}
},
"propertyNames": [
"qualifiedName",
"domain",
"title"
],
"propertyCount": 3
},
"status": "ACTIVE"
}
}
All of our JSON uses this format. Also note that the OMRS REST API is not designed for general use - it is typically used only by the OMRS REST Repository Connector for managing metadata in remote repositories.
from egeria.
I think you have this working now?
from egeria.
Correct, I am able to successfully add an entity and relationship using a very simple body. I think the most useful way to mitigate against similar issues in future would be to fix up/correct the swagger docs, though that will only cover REST (which applies here) - not configuration or messaging. In part that's addressed by #213 though that is purely the 'class' aspect, and there's a lot more here to look at.
Happy for you to track that as you feel makes sense. No code changes needed on creating an entity
from egeria.
I agree we need to fix the swagger and #213 covers it. Trying to keep the OMRS REST API quite hidden as do not want it used outside of the OMRS - however if we publish somthing it should be right :)
from egeria.
Related Issues (20)
- [Enhancement] Add self-build Dockerfile for egeria HOT 3
- Starting Egeria fails with SSL enabled HOT 9
- [BUG] The application.properties file is included in the server chassis jar file HOT 1
- [Enhancement] Add 'plain' server chassis jar into published artifact
- [BUG] ClassCastException at getSchemaTypeForElement (Asset-Manager) HOT 18
- [RELEASE] Release 4.2 HOT 3
- [BUG] OMVS Rex bug, pre traversal displays a count including the deleted entities, but traversal does not return deleted entities HOT 1
- [Enhancement] Add RootCategory classification to CIM glossary HOT 2
- [Enhancement] Egeria file layout proposal to simplify deployment HOT 4
- [Enhancement] Add new view services to Egeria UI application HOT 1
- [Enhancement] Support the capabilities of Apache Atlas classifications HOT 3
- [Enhancement] Add OWASP depenency scanner for Gradle HOT 1
- OMRS-XTDB-REPOSITORY-0026 Cannot sort by property By property value (Ascending) on types: [ControlledGlossaryTerm, GlossaryTerm] HOT 1
- Remove sonatype Lift checks from Egeria repositories HOT 1
- [RELEASE] Release 4.3 HOT 1
- Series Tutorials HOT 10
- [Enhancement] The official website is not up to date, resulting in running errors HOT 3
- [BUG] Deprecated feature in gradle build HOT 1
- [Enhancement] Add framework clients to all OMASs HOT 6
- [RELEASE] Release 4.4 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from egeria.