Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.sun.syndication.feed.rss.Channel/Feed should be rendered by RssChannelHttpMessageConverter/AtomFeedHttpMessageConverter by default [SPR-9336] #13974

Closed
spring-projects-issues opened this issue Apr 20, 2012 · 5 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

allnightlong opened SPR-9336 and commented

I've got this simple controller with rss method:

@RequestMapping(value = "/rss", method = RequestMethod.GET)
@ResponseBody
public Channel rss() {
	...
	return channel ;
}

currently in this situation spring will converted channel to json.
I think, it is not quite right and intuitive.


Affects: 3.1.1

@spring-projects-issues
Copy link
Collaborator Author

allnightlong commented

I've made pull request for this issue (#70), but unfortunately I don't have enouth time\will to complete Contributor guidelines.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

What's the Accept header?

Try adding the following for predictable results, assuming the intent is to produce an RSS feed:

@RequRequestMapping(value = "/rss", method = RequestMethod.GET, produces="atom/rss+xml")

@spring-projects-issues
Copy link
Collaborator Author

allnightlong commented

I know, that by setting correct "produces" field on RequestMapping annotation, my result will convert in RSS. But I am absolutely sure, that com.sun.syndication.feed.rss.Channel should convert to RSS by default.
Currently it converted to json, which is not intuitive at all and doesn't feel quite right.
That happens because, in converters list MappingJacksonHttpMessageConverter stands before RssChannelHttpMessageConverter.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Okay, I see your point. RSS and Atom rely on very specific return value types (in addition to the Accept header) so they can be higher in the order of registration without affecting JSON serialization. Seems unlikely those would ever need to be combined with JSON and even then produces can be used as an override.

@spring-projects-issues
Copy link
Collaborator Author

allnightlong commented

Yes, you've expressed my point better, than I did:)

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.2 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants