Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Allow specifying internal fields as required_fields #941

Closed
jmuk opened this issue Jan 19, 2017 · 2 comments
Closed

Allow specifying internal fields as required_fields #941

jmuk opened this issue Jan 19, 2017 · 2 comments
Assignees

Comments

@jmuk
Copy link
Contributor

jmuk commented Jan 19, 2017

Right now only the fields in the request object is cared for required_fields, but googleapis/google-cloud-node#1926 reports that syncRecognize requires to specify some fields in config, and audio's content should exist somewhere. I think the same pattern will be seen in other APIs.

Can we list up sub fields as the required parameters? I'm thinking like,

methods:
- name: SyncRecognize
  required_fields:
  - config.encoding
  - config.sampling_rate
  - audio.audio_source

There are several things which are unclear to me:

  • how to decide the sample value for sampling_rate? Some default values (like 0 or 1) is probably helpless and still confusing
  • audio.audio_source is oneof -- it should specify either of content or uri, how to choose one?
  • content is bytes type. how to decide the sample value? an empty string or something like 'data' is also helpless. Ideally the sample should read data from some file?

Any thoughts?

@garrettjonesgoogle
Copy link
Member

It seems that you might be conflating required (enforced at runtime on the client side) with sample code config. Sample code generation can be configured to generate code which populates sub fields - see Pub/Sub for one example:

https://github.com/googleapis/googleapis/blob/master/google/pubsub/v1/pubsub_gapic.yaml#L375

It's also possible to specify initial values too.

@jmuk
Copy link
Contributor Author

jmuk commented Jan 20, 2017

Alright, I was wrong, this is more like a configuration issue on cloud_speech_gapic.yaml in googleapis repo.

I've filed a series of issues shown above, and closing this issue itself with them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants