Repository navigation
add admin LIST API filters - #684
Merged
Merged
Conversation
Signed-off-by: Kacper Kozera <kacper.kozera@here.com>
Code Coverage
|
Signed-off-by: Kacper Kozera <kacper.kozera@here.com>
Code Coverage
|
Marcin-Here
requested changes
Nov 4, 2026
| @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); |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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); |
Contributor
There was a problem hiding this comment.
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); |
Signed-off-by: Kacper Kozera <kacper.kozera@here.com>
Code Coverage
|
Marcin-Here
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.