Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Add unit tests to cover XML formatters and methods returning objects #1072

Closed
yishaigalatzer opened this issue Aug 28, 2014 · 5 comments
Closed
Assignees
Milestone

Comments

@yishaigalatzer
Copy link
Contributor

For the following method

public object DoSomething()
{
    return new User();
}

The json formatter will work fine, but the XML formatter barfs because it doesn't get the right declared type. I'm putting out a PR to fix it, but this indicates that host of tests are missing for this case and if we return an ObjectResult directly

@kichalla
Copy link
Member

Just FYI...ran into this just now...in my case i was using json formatter..a write from this formatter is giving a chunked response in case of weblistener where as in IIS it does not...

@yishaigalatzer
Copy link
Contributor Author

The comment is not related to this issue.

Also I believe it is fine. A user can add a buffering middleware, we are not going to add more unnecessary buffering in mvc.

Open an issue against the weblistener host yo be consistent with Helios if you want the behaviors to be identical.

-----Original Message-----
From: "Kiran Challa" [email protected]
Sent: ‎8/‎30/‎2014 3:06 PM
To: "aspnet/Mvc" [email protected]
Cc: "Yishai Galatzer" [email protected]
Subject: Re: [Mvc] Add unit tests to cover XML formatters and methodsreturning objects (#1072)

Just FYI...ran into this just now...in my case i was using json formatter..a write from this formatter is giving a chunked response in case of weblistener where as in IIS it does not...

Reply to this email directly or view it on GitHub.

@kichalla
Copy link
Member

Sure, filed in WebListener repo now: aspnet/HttpSysServer#61

@rynowak
Copy link
Member

rynowak commented Sep 2, 2014

@kichalla you can also use a result filter to buffer

sornaks pushed a commit that referenced this issue Sep 22, 2014
…Result and for XmlFormatters with DeclaredType as object.
@sornaks
Copy link

sornaks commented Sep 22, 2014

Checked in - 96318dc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants