This repository was archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
extend requests #13
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be nice to be able to define a base request
---
base: true
id: base
headers:
host: "{{$ baseUrl}}"
accept: application/json
user-agent: "{{$ userAgent}}"
authorization: "Bearer {{! secretToken}}"
---
extends: base
id: posts/getPosts
description: Get all posts from the blog
http: |+
GET /posts HTTP/1.1
---Overall
- Mixing base requests in with the "defined" requests makes working with restfiles harder. The consumer must now sort between these two types
- Possible solutions would be sort the requests so parse returns
[collection, data, baseRequests, ...requests]OR implement restfile objects and let that abstract it.restfile.baseRequestsandrestfile.requests
- Possible solutions would be sort the requests so parse returns
Parsing
- Merge base request in to extending request
- Retain base request after parsing
- Populate variables, secrets and prompts in base requests
Validation
-
request.extendsreferences requests that exist and markedbase: true -
request.httpshould not be defined on base requests
Future
- It would be nice to support base requests defining
httpand merging them. Doing this with the verb, target, headers wouldn't be too hard. This will be trickier with body because it will depend on what that body content is. In most cases there won't be a good merge strategy other than prepend or append. Even then which one? Some body content types likeapplication/jsoncould be merged but that's not straight forward and there are different algorithms for that.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request