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

Minor: Add inheritedFields for list apis response #14179

Merged
merged 2 commits into from
Nov 30, 2023
Merged
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 @@ -563,6 +563,7 @@ public final List<T> listAll(Fields fields, ListFilter filter) {
List<T> entities = new ArrayList<>();
for (String json : jsons) {
T entity = setFieldsInternal(JsonUtils.readValue(json, entityClass), fields);
entity = setInheritedFields(entity, fields);
entity = clearFieldsInternal(entity, fields);
entities.add(entity);
}
Expand All @@ -578,6 +579,7 @@ public ResultList<T> listAfter(UriInfo uriInfo, Fields fields, ListFilter filter

for (String json : jsons) {
T entity = setFieldsInternal(JsonUtils.readValue(json, entityClass), fields);
entity = setInheritedFields(entity, fields);
entity = clearFieldsInternal(entity, fields);
entities.add(withHref(uriInfo, entity));
}
Expand Down Expand Up @@ -610,6 +612,7 @@ public ResultList<T> listAfterWithSkipFailure(
for (String json : jsons) {
try {
T entity = setFieldsInternal(JsonUtils.readValue(json, entityClass), fields);
entity = setInheritedFields(entity, fields);
entity = clearFieldsInternal(entity, fields);
entities.add(withHref(uriInfo, entity));
} catch (Exception e) {
Expand All @@ -633,6 +636,7 @@ public ResultList<T> listBefore(UriInfo uriInfo, Fields fields, ListFilter filte
List<T> entities = new ArrayList<>();
for (String json : jsons) {
T entity = setFieldsInternal(JsonUtils.readValue(json, entityClass), fields);
entity = setInheritedFields(entity, fields);
entity = clearFieldsInternal(entity, fields);
entities.add(withHref(uriInfo, entity));
}
Expand Down Expand Up @@ -668,6 +672,7 @@ public T getVersion(UUID id, String version) {

public EntityHistory listVersions(UUID id) {
T latest = setFieldsInternal(find(id, ALL), putFields);
latest = setInheritedFields(latest, putFields);
String extensionPrefix = EntityUtil.getVersionExtensionPrefix(entityType);
List<ExtensionRecord> records = daoCollection.entityExtensionDAO().getExtensions(id, extensionPrefix);
List<EntityVersionPair> oldVersions = new ArrayList<>();
Expand Down
Loading