Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gen: Encode ML PredictRequest to JSON once only
The ML API expects users to prepare a JSON-encoded string as part of the payload when building a GoogleCloudMlV1__PredictRequest. However, the generator produces code which assumes a PredictRequest needs to be encoded to JSON, even though the data field is in fact already encoded. Furthermore, the generator produces code that drops the data portion of the API response. This commit adds special handling for requests to the ML predict endpoint, in order to correctly marshal requests and unmarshal responses. For a discussion of API requests and responses, see https://cloud.google.com/ml-engine/docs/v1/predict-request Fixes #241. Change-Id: I6ce90cae80d319b64173dd285051b65b07ba1255 Reviewed-on: https://code-review.googlesource.com/c/34871 Reviewed-by: Jean de Klerk <deklerk@google.com>
- Loading branch information