Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Checking for the nullability / existence of a default value of query parameters that equal an argument name as a sign that they should be considered optional makes sense to me. There's still a combinatorics problem with ordering, but I don't see why that should have to be something you worry about.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 4823e04377a1e6a02956b8267a99c33220df9a60
Author: jbwoods <jbwoods@google.com>
Date: Fri Jun 07 13:27:27 2019
Make deep link query parameters with default values optional
Currently all parameters are required for deeplink arguments to be
parsed correctly. If a parameter is missing, all parameters fail to be
parsed.
By checking for default values and nullability, we can determine whether
a deep link query parameter should be considered optional. This change
also makes the ordering of query params irrelevant.
Test: Added tests
BUG: 133273839
Change-Id: Ifa4d5dfee203b944c48c2371873e99922d5ffc68
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.java
https://android-review.googlesource.com/979166
https://goto.google.com/android-sha1/4823e04377a1e6a02956b8267a99c33220df9a60
Branch: androidx-master-dev
commit 4823e04377a1e6a02956b8267a99c33220df9a60
Author: jbwoods <jbwoods@google.com>
Date: Fri Jun 07 13:27:27 2019
Make deep link query parameters with default values optional
Currently all parameters are required for deeplink arguments to be
parsed correctly. If a parameter is missing, all parameters fail to be
parsed.
By checking for default values and nullability, we can determine whether
a deep link query parameter should be considered optional. This change
also makes the ordering of query params irrelevant.
Test: Added tests
BUG: 133273839
Change-Id: Ifa4d5dfee203b944c48c2371873e99922d5ffc68
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.java
jb...@google.com <jb...@google.com> #4
This has been fixed internally, and will be available in the Navigation 2.2.0-alpha02 release.
b9...@gmail.com <b9...@gmail.com> #5
It looks like I couldn't set placeholder on both path and query...
e.g. pathA/{id}?query1={query1}&query2={query2} -> this will failed
Once I set placeholder on query, it can't recognized any placeholder on path.
e.g. pathA/{id}?query1={query1}&query2={query2} -> this will failed
Once I set placeholder on query, it can't recognized any placeholder on path.
il...@google.com <il...@google.com> #6
Re #5 - please file a new bug with a sample project that reproduces your issue.
Description
Version used: 2.0.0
When defining a deep link in the navigation graph, and exact match is required for parameter matching, with no possibility of marking parameters as optional, thus if only one parameter is omitted, all parameters will fail to be parsed.
This is especially troublesome when supporting many parameters or query configurations, as it isn't feasible to define each variation of parameter configurations.
Expected behaviour would be for NavDeepLink to enclose each parameter with an optional regex group, or to check the NavArgument for nullability.