Skip to content

add admin LIST API filters - #684

Merged
kacper-kozera merged 3 commits into
v3from
v3-278-list-api-additions
Nov 5, 2026
Merged

kacper-kozera merged 3 commits into
v3from
v3-278-list-api-additions

Conversation

@kacper-kozera

Copy link
Copy Markdown

No description provided.

Signed-off-by: Kacper Kozera <kacper.kozera@here.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Code Coverage

Overall Project 60.7% 🍏
Files changed 98.68% 🍏

File Coverage
PropertySelectionPostProcessor.java 100% 🍏
ReadFeatureApiTask.java 93.04% 🍏
SpaceApiTask.java 88.19% 🍏
StorageApiTask.java 88.19% 🍏
TagQueryUtil.java 87.11% 🍏
EventHandlerApiTask.java 86.43% 🍏
AbstractApiTask.java 85.87% -0.3% 🍏

Signed-off-by: Kacper Kozera <kacper.kozera@here.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Code Coverage

Overall Project 60.71% 🍏
Files changed 98.71% 🍏

File Coverage
PropertySelectionPostProcessor.java 100% 🍏
ReadFeatureApiTask.java 93.04% 🍏
SpaceApiTask.java 88.19% 🍏
StorageApiTask.java 88.19% 🍏
TagQueryUtil.java 87.11% 🍏
EventHandlerApiTask.java 86.43% 🍏
AbstractApiTask.java 85.87% -0.3% 🍏
MaskingUtil.java 76.71% 🍏

@NotNull Class<F> type,
@Nullable FeaturePostProcessor<F> masking) {
final QueryParameterList queryParams = ApiParams.queryParamsFromRequest(routingContext);
long limit = ApiParams.extractQueryParamAsLong(queryParams, LIMIT, false, DEF_ADMIN_FEATURE_LIMIT);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for limit in Naksha v3 we usually used "extractQueryParamAsInt" , that way we don't have to cast it to int later.

public T postProcess(T feature) {
final Map<String, Object> targetMap = PropertyPathUtil.extractPropertyMapFromFeature(feature, propPaths);
final Class<T> type = (Class<T>) feature.getClass();
return Platform.javaProxy(Platform.fromJSON(Platform.toJSON(targetMap)), type);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that change we would converse every feature to JSON and parse it back, and it's postProcessor so it's sheared by read API, that can became quite heavy quite fast. Instead we could use something like

final Map<String, Object> targetMap =
    PropertyPathUtil.extractPropertyMapFromFeature(feature, propPaths);

@SuppressWarnings("unchecked")
final Class<T> type = (Class<T>) feature.getClass();

final T selected = Platform.javaProxy(Platform.newMap(), type);
selected.putAll(targetMap);
return selected;

we wouldn't change nested values to Platform objects but it's posproccesor last step before we serialize it as HTTP response.

}
final RequestQuery requestQuery = new RequestQuery();
requestQuery.setTags(tagQuery);
return QueryConverter.PgQueryConverter_C.convert(requestQuery);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see we could make convertTag public here and use it instead of using deprecated setTags, let's consult one of lib-psql owners for that.


public static void maskProperties(NakshaFeature feature, Set<String> lowercasedPropertiesToMask) {
maskProperties(feature.getProperties(), lowercasedPropertiesToMask);
maskProperties((Map<String, Object>) feature, lowercasedPropertiesToMask);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one 😃

Signed-off-by: Kacper Kozera <kacper.kozera@here.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Code Coverage

Overall Project 60.75% 🍏
Files changed 98.71% 🍏

File Coverage
PropertySelectionPostProcessor.java 100% 🍏
ReadFeatureApiTask.java 93.04% 🍏
SpaceApiTask.java 88.19% 🍏
StorageApiTask.java 88.19% 🍏
TagQueryUtil.java 87.11% 🍏
EventHandlerApiTask.java 86.43% 🍏
AbstractApiTask.java 85.76% -0.31% 🍏
MaskingUtil.java 76.71% 🍏

@kacper-kozera
kacper-kozera merged commit 9bc97b8 into v3 Nov 5, 2026
3 checks passed
@kacper-kozera
kacper-kozera deleted the v3-278-list-api-additions branch November 5, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants