Closed bajtos closed 8 years ago
I like the (re)design presented by @STRML in https://github.com/strongloop/strong-remoting/issues/312, especially the fact that we treat built-in and user-provided converters the same way.
I would like to push it a bit further so that user-provided converters can decide how to deal with sloppy coercion from url-encoded sources.
Here are few high-level cases that each converter has to support:
?filter[where]=1
and
JSON encoding ?filter={"where":1}
.Additionally, I'd like to make it easy for for user-provided converters to run built-in sloppy conversion first before applying further transformation.
Last but not least, the registry of converters should be scoped to RemoteObject instance, as opposed to current global singleton Dynamic
. This is needed to support applications running multiple LoopBack app instances in the same process, where each app may provide different converter for the same type (model name). For backwards compatibility, we can fall back to global Dynamic
for types that are not found in the local registry.
/cc @ritch @alexpit
Most of the items were already done in #343.
Refactor handling of "accepts" and "returns" type descriptors, create a class providing information like "isArrayType" or "isAnyType".
This was not needed in the new implementation.
A follow-up for #207.
SharedMethod
to contexts (HttpContext
and friends)SharedMethod
should only validate that argument values match argument typesnull
value as empty, i.e. reject requests providing null value for a required argument.