Skip to content
Unverified Commit acc56f83 authored by david-perez's avatar david-perez Committed by GitHub
Browse files

Always set `Content-Type` header in RestJson1 responses (#1131)

The protocol specifies it should be set by default to `application/json`
in HTTP responses, even when there are no output shape members, since in
that case an empty JSON payload `{}` is serialized. There are server
protocol tests asserting this behavior.

To implement this behavior, the `RestJsonHttpBindingResolver` class has
been introduced, which mostly delegates to the
`HttpTraitHttpBindingResolver`, but tweaks the response `Content-Type`
header.

Note this behavior is different than the client's, which should not
serialize a JSON payload if there are no input shape members to be
serialized to the body, and as such does not need to set the
`Content-Type` header.

This commit also deletes the `ServerRestJson` and `ServerRestXml`
classes, since they were exact copies of their client counterparts. The
latter was hosted in `ServerRustXml.kt`, which has been renamed to
`ServerRestXml.kt`.
parent 0228d5ed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment