mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-25 08:58:26 +00:00
Update add-new-aspect.md
This commit is contained in:
parent
e69b83442d
commit
a76a8f834c
@ -12,7 +12,7 @@ We'll use the [CorpUserEditableInfo](https://github.com/linkedin/datahub/blob/ma
|
||||
./gradlew :gms:build -Prest.model.compatibility=ignore
|
||||
```
|
||||
|
||||
4. To surface the new aspect at the top-level [resource endpoint](https://linkedin.github.io/rest.li/user_guide/restli_server#writing-resources), extend the resource data model (e.g. [`CorpUser`](https://github.com/linkedin/datahub/blob/master/gms/api/src/main/pegasus/com/linkedin/identity/CorpUser.pdsc)) with an optional field (e.g. [`editableInfo`](https://github.com/linkedin/datahub/blob/master/gms/api/src/main/pegasus/com/linkedin/identity/CorpUser.pdsc#L19)). You'll also need to extend the `toValue` & `toSnapshot` methods of the top-level resource (e.g. [`CorpUsers`](https://github.com/linkedin/datahub/blob/master/gms/impl/src/main/java/com/linkedin/identity/rest/resources/CorpUsers.java) to convert between the snapshot & value models.
|
||||
4. To surface the new aspect at the top-level [resource endpoint](https://linkedin.github.io/rest.li/user_guide/restli_server#writing-resources), extend the resource data model (e.g. [`CorpUser`](https://github.com/linkedin/datahub/blob/master/gms/api/src/main/pegasus/com/linkedin/identity/CorpUser.pdsc)) with an optional field (e.g. [`editableInfo`](https://github.com/linkedin/datahub/blob/master/gms/api/src/main/pegasus/com/linkedin/identity/CorpUser.pdsc#L19)). You'll also need to extend the `toValue` & `toSnapshot` methods of the top-level resource (e.g. [`CorpUsers`](https://github.com/linkedin/datahub/blob/master/gms/impl/src/main/java/com/linkedin/identity/rest/resources/CorpUsers.java)) to convert between the snapshot & value models.
|
||||
|
||||
5. (Optional) If there's need to update the aspect via API (instead of/in addition to MCE), add a [sub-resource](https://linkedin.github.io/rest.li/user_guide/restli_server#sub-resources) endpoint for the new aspect (e.g. [`CorpUsersEditableInfoResource`](https://github.com/linkedin/datahub/blob/master/gms/impl/src/main/java/com/linkedin/identity/rest/resources/CorpUsersEditableInfoResource.java)). The sub-resource endpiont also allows you to retrieve previous versions of the aspect as well as additional metadata such as the audit stamp.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user