Skip to content

Routine Discovery shouldn't produce unused parameters #46

@rayruizhiliao

Description

@rayruizhiliao

Every parameter should be used (and eventually resolved) in the operations. If there's an unused / unresolved parameter, routine discovery should catch it. For instance, this below routine shouldn't be produced, as page and size wouldn't be resolved.

{
  "id": "Routine_4caef1f3-1026-4f9f-888c-876707b5be2e",
  "created_at": 1763750567,
  "updated_at": 1763750567,
  "name": "sam_gov_latest_search_by_keyword",
  "description": "Routine to navigate to SAM.gov Search, then perform the SGS keyword search for the latest results (sorted by -modifiedDate) using the captured request pattern.",
  "operations": [
    {
      "type": "navigate",
      "url": "https://sam.gov/search/?page=1&pageSize=25&sort=-modifiedDate&sfm%5BsimpleSearch%5D%5BkeywordRadio%5D=ALL&sfm%5BsimpleSearch%5D%5BkeywordTags%5D%5B0%5D%5Bkey%5D=\"{{q}}\"&sfm%5BsimpleSearch%5D%5BkeywordTags%5D%5B0%5D%5Bvalue%5D=\"{{q}}\"&sfm%5Bstatus%5D%5Bis_active%5D=true"
    },
    {
      "type": "sleep",
      "timeout_seconds": 2.5
    },
    {
      "type": "fetch",
      "endpoint": {
        "url": "https://sam.gov/api/prod/sgs/v1/search/?random={{epoch_milliseconds}}&index=_all&page={{page}}&mode=search&sort=-modifiedDate&size={{size}}&mfe=true&q=\"{{q}}\"&qMode=ALL&is_active=true",
        "description": "Keyword search across SAM.gov datasets, sorted by latest modified date (observed GET request).",
        "method": "GET",
        "headers": {
          "sec-ch-ua-platform": "\"macOS\"",
          "Referer": "https://sam.gov/search/?page=1&pageSize=25&sort=-modifiedDate&sfm%5BsimpleSearch%5D%5BkeywordRadio%5D=ALL&sfm%5BsimpleSearch%5D%5BkeywordTags%5D%5B0%5D%5Bkey%5D=\"{{q}}\"&sfm%5BsimpleSearch%5D%5BkeywordTags%5D%5B0%5D%5Bvalue%5D=\"{{q}}\"&sfm%5Bstatus%5D%5Bis_active%5D=true",
          "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
          "Accept": "application/json, text/plain, */*",
          "sec-ch-ua": "\"Chromium\";v=\"142\", \"Google Chrome\";v=\"142\", \"Not_A Brand\";v=\"99\"",
          "sec-ch-ua-mobile": "?0"
        },
        "body": {},
        "credentials": "same-origin"
      },
      "session_storage_key": "sam.gov.search.results"
    },
    {
      "type": "return",
      "session_storage_key": "sam.gov.search.results"
    }
  ],
  "incognito": true,
  "parameters": [
    {
      "name": "q",
      "type": "string",
      "required": true,
      "description": "Keyword(s) to search for.",
      "default": "ptsd",
      "examples": [
        "ptsd",
        "cybersecurity",
        "electric vehicle"
      ],
      "min_length": 1,
      "max_length": null,
      "min_value": null,
      "max_value": null,
      "pattern": null,
      "enum_values": null,
      "format": null
    },
    {
      "name": "page",
      "type": "integer",
      "required": true,
      "description": "Zero-based page number for pagination.",
      "default": 0,
      "examples": [
        0,
        1,
        2
      ],
      "min_length": null,
      "max_length": null,
      "min_value": 0,
      "max_value": null,
      "pattern": null,
      "enum_values": null,
      "format": null
    },
    {
      "name": "size",
      "type": "integer",
      "required": true,
      "description": "Number of results per page.",
      "default": 25,
      "examples": [
        10,
        25,
        50
      ],
      "min_length": null,
      "max_length": null,
      "min_value": 1,
      "max_value": 100,
      "pattern": null,
      "enum_values": null,
      "format": null
    }
  ]
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions