Skip to content

Require languageCode to be explicitly specified.#2186

Merged
stephenplusplus merged 4 commits into
googleapis:masterfrom
lukesneeringer:speech-v1-language
Apr 4, 2017
Merged

Require languageCode to be explicitly specified.#2186
stephenplusplus merged 4 commits into
googleapis:masterfrom
lukesneeringer:speech-v1-language

Conversation

@lukesneeringer

@lukesneeringer lukesneeringer commented Apr 4, 2017

Copy link
Copy Markdown
Contributor

We need to require our users to explicitly require languageCode. Defaulting to English is not acceptable. (The API changed this for a reason; it was a common point of failure for users.)

@lukesneeringer lukesneeringer self-assigned this Apr 4, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 4, 2017
*
* @param {object} config - A `StreamingRecognitionConfig` object. See
* [`StreamingRecognitionConfig`](https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#google.cloud.speech.v1beta1.StreamingRecognitionConfig).
* @param {string} config.languageCode - The language of the supplied audio as

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus added the api: speech Issues related to the Speech-to-Text API. label Apr 4, 2017
delete config.languageCode;
}
if (is.undefined(config.config.languageCode)) {
throw new Error('A `languageCode` is required in the config object.');

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

// As of Speech v1, a language code is required; throw an exception if we
// did not receive one.
if (is.undefined(config.languageCode)) {
throw new Error('A `languageCode` is required in the config object.');

This comment was marked as spam.

@lukesneeringer

Copy link
Copy Markdown
Contributor Author

@stephenplusplus Anything else? (Other than CI, of course.)

@stephenplusplus

Copy link
Copy Markdown
Contributor

Nope, LGTM.

@lukesneeringer

Copy link
Copy Markdown
Contributor Author

Can you flip the approve bit, then? :-D

Still looks like there are CI issues though. Investigating that.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 7e5b3d8 on lukesneeringer:speech-v1-language into 6f39cb4 on GoogleCloudPlatform:master.

@stephenplusplus stephenplusplus merged commit 7ed4291 into googleapis:master Apr 4, 2017
sofisl pushed a commit that referenced this pull request Feb 24, 2026
* chore(deps): update dependency mkdirp to v3 (#2077)

* chore(deps): update dependency sinon to v19 (#2186)

* chore(deps): update dependency nise to v6.1.1 (#2193)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: speech Issues related to the Speech-to-Text API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants