fn generate_body_parser(operation: &Operation, service: &Service<'_>) -> String {
    if operation.output.is_none() {
        return "let result = ::std::mem::drop(response);".to_string();
    }

    let shape_name = &operation.output.as_ref().unwrap().shape;
    let output_shape = &service
        .get_shape(shape_name)
        .expect("Shape missing from service definition");

    let mutable_result = output_shape
        .members
        .as_ref()
        .unwrap()
        .iter()
        .any(|(_, member)| member.location.is_some())
        || output_shape.payload.is_some();

    match output_shape.payload {
        None => json_body_parser(shape_name, mutable_result),
        Some(ref payload_member_name) => {
            let payload_member_shape =
                &output_shape.members.as_ref().unwrap()[payload_member_name].shape;
            let payload_shape = &service
                .get_shape(payload_member_shape)
                .expect("Shape missing from service definition");
            // is the shape required?
            let payload_shape_required = match output_shape.required {
                Some(ref s) => !s.is_empty(),
                None => false,
            };
            match payload_shape.shape_type {
                payload_type
                    if payload_type == ShapeType::Blob || payload_type == ShapeType::String =>
                {
                    payload_body_parser(
                        payload_type,
                        shape_name,
                        payload_member_name,
                        mutable_result,
                        payload_shape_required,
                    )
                }
                _ => json_body_parser(shape_name, false),
            }
        }
    }
}
Generate code to parse the http response body, either as a JSON object
deserialized with serde, or as a raw payload that's assigned to one of
the fields in the result object.

Needs to determine whether or not other fields in the result object
will be set later (e.g. from headers), so the compiler won't spit out
warnings about unnecessary mutability
service_crategen/src/commands/generate/codegen/rest_json.rs