You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
It would be nice to be able to define a base request
---
base: trueid: baseheaders:
host: "{{$ baseUrl}}"accept: application/jsonuser-agent: "{{$ userAgent}}"authorization: "Bearer {{! secretToken}}"
---
extends: baseid: posts/getPostsdescription: Get all posts from the bloghttp: |+ 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.baseRequests and restfile.requests
Parsing
Merge base request in to extending request
Retain base request after parsing
Populate variables, secrets and prompts in base requests
Validation
request.extends references requests that exist and marked base: true
request.http should not be defined on base requests
Future
It would be nice to support base requests defining http and 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 like application/json could be merged but that's not straight forward and there are different algorithms for that.
It would be nice to be able to define a base request
Overall
[collection, data, baseRequests, ...requests]OR implement restfile objects and let that abstract it.restfile.baseRequestsandrestfile.requestsParsing
Validation
request.extendsreferences requests that exist and markedbase: truerequest.httpshould not be defined on base requestsFuture
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.