Hello,
I created a type with one of the attributes of type int indicated as
optional.
I then created an entity without supplying value for the optional attribute.
when I retrieve that entity, the value of the optional attribute is
actually zero.
I expected the returned json to not include that attribute.
Here is what I did:
curl -X POST -u admin:admin -d '{"entityDefs":[{"name": "TestEntity",
"category": "ENTITY","attributeDefs": [{"name": "id","typeName":
"string","isOptional": false},{"name": "age","typeName":
"int","isOptional": true}]}]}' -H "Content-Type: application/json"
http://localhost:21000/api/atlas/v2/types/typedefs
curl -X POST -u admin:admin -d '{"entities" : [{"typeName":
"TestEntity","attributes": {"id": "123"}}]}' -H "Content-Type:
application/json" http://localhost:21000/api/atlas/v2/entity/bulk
curl -u admin:admin
http://localhost:21000/api/atlas/v2/entity/guid/48d6f3e8-0133-4ce2-b408-74df73bbb376
{"referredEntities":{},"entity":{"typeName":"TestEntity","attributes":{"id":"123","age":0},"guid":"48d6f3e8-0133-4ce2-b408-74df73bbb376","status":"ACTIVE","createdBy":"admin","updatedBy":"admin","createTime":1572518090211,"updateTime":1572518090211,"version":0}}
Thanks,
Fadi