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
Support for the "type" parameter for Atom Feed/Entry message conversion [SPR-17040] #21578
Comments
Rossen Stoyanchev commented Original comment and discussion under #15531. |
Rossen Stoyanchev commented Mark Hobson, I don't quite see what the proposed change accomplishes. In light of your comment under #15531 for "type=feed" vs "type=entry", this does not change what gets rendered. If a client requests We could go a step further and prevent the mapping in the first place, see my comment under #21670 to use parameters declared in the produces condition to narrow the request mapping. But can you explain how do you benefit from the change proposed in the attached PR? |
Mark Hobson commented Apologies for the confusion Rossen Stoyanchev. This PR is related to #15531 but doesn't purport to fix that - I'll comment there regarding content negotiation. The problem that this PR addresses is this: when Spring's This becomes relevant when an application also has an Atom entry message converter so that they can both write their correct |
Rossen Stoyanchev commented Okay, I see. In that case if the PR is applied, and with all else being the same (i.e. without your other customization to support type=entry), the AtomFeedHttpMessageConverter will happily render a First, we will try and address #21670 for 5.2 which should make this possible: @GetMapping(path = "/foo", produces = "application/atom+xml;type=feed")
public Feed getFooFeed() {
// ...
}
@GetMapping(path = "/foo", produces = "application/atom+xml;type=entry")
public Entry getFooEntry() {
// ...
} The above should help narrow the mappings, also taking the declared type parameter in mind. Beyond that it would make sense to add explicit support for the "type" parameter in any Atom-specific sub-classes of |
Mark Hobson commented That sounds like a good approach, thanks. I'll comment on #21670 with a link to example code for my use-cases. Shall I raise another issue for adding an Atom feed entry message converter to Spring too? An initial implementation will be in my example code. |
This is superseded by #1885. |
Mark Hobson opened SPR-17040 and commented
AtomFeedHttpMessageConverter
andRssChannelHttpMessageConverter
currently discard any media type parameters that are supplied towrite()
. They are overwritten when adding the charset parameter.Affects: 4.3.18, 5.0.7
Issue Links:
Referenced from: pull request #1885
The text was updated successfully, but these errors were encountered: