Skip to content

[FEATURE] Request Chaining & Variable Extraction #9

Description

@kavix

The save/run feature exists for replaying single requests, but there is no way to chain dependent requests (e.g., login -> get token -> use token -> fetch data).

Proposed Implementation

kurl chain login.yaml fetch-data.yaml

YAML/JSON chain definitions:

steps:
  - name: login
    request: POST https://api.example.com/auth
    body: '{"user":"admin","pass":"secret"}'
    extract:
      token: '.token'
  - name: fetch-data
    request: GET https://api.example.com/data
    headers:
      Authorization: "Bearer {{login.token}}"

Variable extraction via JSONPath/regex

Conditional branching:

--if-status 200
--retry-on 401

Why this matters

Real API workflows involve multiple dependent steps. Manual token copying between commands is inefficient.

Acceptance Criteria

  • YAML chain definition format
  • Variable extraction from responses
  • Interpolation in subsequent requests
  • Error handling and rollback
  • Loop/repeat support for pagination

Issue #6: OpenAPI / Swagger Integration

No integration with API specifications. Users must manually discover endpoints and construct requests.

Proposed Implementation

kurl openapi https://api.example.com/openapi.json --list-endpoints
kurl openapi ./spec.yaml --call getUsers

Auto-populate headers, parameters, and body from spec

Validate requests against schema before sending

Generate kurl save profiles from OpenAPI specs

Why this matters

OpenAPI is the standard for API documentation. Auto-discovery eliminates guesswork.

Acceptance Criteria

  • OpenAPI 3.0 and 2.0 parsing
  • Endpoint listing and search
  • Request building from spec
  • Response validation against schema
  • Export discovered endpoints as kurl profiles

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions