Skip to content

ReflectionExtensions.CreateInstanceFromString() does not handle empty integers #177

@JornWildt

Description

@JornWildt

Given a handler like this:

public object some_handler(int? x = null)

registered with an URI like this:

.AtUri("/path?x={x}")

OpenRasta will assign NULL to x if the URL parameter "x" is not present in HTTP GET.

But if "x" is present, but empty as in "http://host/path?x=", OpenRasta will not detect "x" as empty - instead it fails to convert the empty string value of "x" to an integer and the result is that OpenRasta fails to match the method and yields the message "None of the operations had members that could be matches against the uri parameters: ..."

It can be argued that, yes, the empty string cannot be converted to integer - but you could also argue that it is a reasonable special case that makes your client implementation simpler (which IMHO is a good thing).

This is experienced in 2.5.2001 and may be changed in later versions of OpenRasta.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions