GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Restrict API call query parameters to what we say we accept · Issue #653 · googleapis/google-cloud-node

Restrict API call query parameters to what we say we accept #653

New issue
Copy link
New issue
Copy link
Closed
Closed
Restrict API call query parameters to what we say we accept#653
Copy link
Assignees
stephenplusplus
Labels
core

Description

@stephenplusplus
stephenplusplus
opened on Jun 10, 2015
Issue body actions

Related: #647, #652

Right now, we sometimes kind of blindly pass the user's provided object to the API. We should be sure to only pass through what we say in our docs we accept.

I'm thinking something like:

/**
 * @param query.maxResults
 * @param query.pageSize
 */
Service.prototype.method = function(query, callback) {
  var allowedQueryParameters = ['maxResults', 'pageSize'];
  var requestQuery = util.pluck(query, allowedQueryParameters);
  // If `query` had more on it, we get a new object back with just the
  // params we want the API to receive.

  callApi('POST', '/path', requestQuery);
};

Activity

  1. stephenplusplus
    added
    core
    on Jun 10, 2015
  2. ryanseys commented on Jun 10, 2015

    @ryanseys
    ryanseys
    on Jun 10, 2015
    Contributor
    More actions

    Interesting idea, I've explored a similar idea before in googleapis with required parameters here, however sometimes there are an outrageous number of different optional parameters that can be passed which is just tedious to document. Additionally, if implemented, this actually wouldn't really solve the problem of us mis-documenting the required parameters and letting something like #647 sneak through because of our human error. Also, this would make non-breaking additional parameters added to the API silently (which Google likes to do from time to time) effectively refuse that functionality. Yes that'd be good as long as the user files a bug and we fix it, but its still scary to the user when they are doing the right thing and we aren't.

  3. stephenplusplus commented on Jun 10, 2015

    @stephenplusplus
    stephenplusplus
    on Jun 10, 2015
    ContributorAuthor
    More actions

    Okay, let's do it the way we're doing it. 👍

    Will close, anyone feel free to re-open if there's a better solution than "nevermind" :)

  4. stephenplusplus
    closed this as completedon Jun 10, 2015
  5. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  6. sofisl
    added 2 commits that reference this issue on Nov 11, 2022

    fix: publish missing client config annotations (#653)

    8b23161

    chore: release 3.1.1 (#655)

    235664a
  7. sofisl
    added 2 commits that reference this issue on Jan 24, 2023

    chore: update bucket for cloud-rad (#653)

    0698835

    chore: update bucket for cloud-rad (#653)

    02c6ab9
  8. miguelvelezsa
    added a commit that references this issue on Jul 23, 2025

    feat: export APICallback type (#653)

    b200f18
  9. sofisl
    added 5 commits that reference this issue on Jan 27, 2026

    build: migrate to secret manager (#653)

    c4b4796

    build: migrate to secret manager (#653)

    568cf37

    build: migrate to secret manager (#653)

    a834b73

    build: migrate to secret manager (#653)

    7d2e744

    build: migrate to secret manager (#653)

    71a359f
  10. miguelvelezsa
    added a commit that references this issue on Jan 28, 2026

    chore(deps): update dependency ts-loader to v7 (#653)

    2643fb5
  11. sofisl
    added 2 commits that reference this issue on Feb 4, 2026

    migrate code from googleapis/cloud-profiler-nodejs (#7087)

    288deb4

    chore(deps): update dependency ts-loader to v7 (#653)

    ba18e14
  12. GautamSharda
    added a commit that references this issue on Feb 5, 2026

    fix: remove pip install statements (#1546) (#653)

    52779aa
  13. sofisl
    added a commit that references this issue on Feb 17, 2026

    chore(deps): update dependency ts-loader to v7 (#653)

    b551e0b
  14. GautamSharda
    added a commit that references this issue on Feb 23, 2026

    fix: remove pip install statements (#1546) (#653)

    5567073
  15. sofisl
    added a commit that references this issue on Feb 24, 2026

    build: add configuration for automated doc deployment (#653)

    9a12cce
  16. GautamSharda
    added a commit that references this issue on Feb 26, 2026

    fix: remove pip install statements (#1546) (#653)

    31b92c8
  17. GautamSharda
    added a commit that references this issue on Mar 12, 2026

    chore: migrate to owl bot (#653)

    0fc849f
  18. sofisl
    added 2 commits that reference this issue on Mar 17, 2026

    feat!: Headers should be `Headers` (#653)

    988d769

    fix: remove the space from the log system string (#653)

    e849166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

core

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.