Skip to content

Commit

Permalink
Update docs to remove id fields
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Dec 7, 2023
1 parent 4538bb4 commit aa6439d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 34 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Slumber is based around **collections**. A collection is a group of request **re
# slumber.yml
id: example
requests:
- id: get
get:
method: GET
url: https://httpbin.org/get
```
Expand Down
1 change: 0 additions & 1 deletion docs/src/api/chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ To use a chain in a template, reference it as `{{chains.<id>}}`.

| Field | Type | Description | Default |
| ----------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------- | -------- |
| `id` | `string` | Unique identifier for this chain | Required |
| `source` | [`ChainSource`](./chain_source.md) | Source of the chained value | Required |
| `sensitive` | `boolean` | Should the value be hidden in the UI? | `false` |
| `selector` | [`JSONPath`](https://www.ietf.org/archive/id/draft-goessner-dispatch-jsonpath-00.html) | Selector to narrow down results in a chained JSON value | `null` |
Expand Down
9 changes: 4 additions & 5 deletions docs/src/api/profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ Profiles also support nested templates, via the `!template` tag.

## Fields

|| Field | Type | Description | Default |
| ------ | ----------------------------------------------------- | ---------------------------------- | ------------- | ------- |
| `id` | `string` | Unique identifier for this profile | Required |
| `name` | `string` | Descriptive name to use in the UI | Value of `id` |
| `data` | [`mapping[string, ProfileValue]`](./profile_value.md) | Fields, mapped to their values | `{}` |
| Field | Type | Description | Default |
| ------ | ----------------------------------------------------- | --------------------------------- | ---------------------- |
| `name` | `string` | Descriptive name to use in the UI | Value of key in parent |
| `data` | [`mapping[string, ProfileValue]`](./profile_value.md) | Fields, mapped to their values | `{}` |

## Examples

Expand Down
4 changes: 2 additions & 2 deletions docs/src/api/profile_value.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ In the case of a nested template, the inner template will be rendered into its o
## Examples

```yaml
!raw http://localhost:5000
---
# The !raw key is the default, and can be omitted
http://localhost:5000
---
!raw http://localhost:5000
---
!template http://{{hostname}}
```
30 changes: 15 additions & 15 deletions docs/src/api/request_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ Each collection needs a unique ID (via the `id` field). This ID is used to tie t

A request collection supports the following top-level fields:

| Field | Type | Description | Default |
| ---------- | -------------------------------------------- | ----------------------------- | -------- |
| `id` | `string` | Unique ID for this collection | Required |
| `profiles` | [`list[Profile]`](./profile.md) | Static template values | [] |
| `requests` | [`list[RequestRecipe]`](./request_recipe.md) | Requests Slumber can send | [] |
| `chains` | [`list[Chain]`](./chain.md) | Complex template values | [] |
| Field | Type | Description | Default |
| ---------- | ------------------------------------------------------- | ----------------------------- | -------- |
| `id` | `string` | Unique ID for this collection | Required |
| `profiles` | [`mapping[string, Profile]`](./profile.md) | Static template values | [] |
| `requests` | [`mapping[string, RequestRecipe]`](./request_recipe.md) | Requests Slumber can send | [] |
| `chains` | [`mapping[string, Chain]`](./chain.md) | Complex template values | [] |

## Examples

```yaml
id: example

profiles:
- id: local
local:
name: Local
data:
host: http://localhost:5000
user_guid: abc123
- id: prd
prd:
name: Production
data:
host: https://httpbin.org
user_guid: abc123

chains:
- id: username
username:
source: !file ./username.txt
- id: password
password:
source: !prompt Password
sensitive: true
- id: auth_token
auth_token:
source: !request login
selector: $.token

Expand All @@ -68,8 +68,8 @@ base: &base
Content-Type: application/json

requests:
- <<: *base
id: login
login:
<<: *base
method: POST
url: "{{host}}/anything/login"
body: |
Expand All @@ -78,8 +78,8 @@ requests:
"password": "{{chains.password}}"
}
- <<: *base
id: Get User
get_user:
<<: *base
method: GET
url: "{{host}}/anything/current-user"
query:
Expand Down
17 changes: 8 additions & 9 deletions docs/src/api/request_recipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ A request recipe defines how to make a particular request. For a REST API, you'l

## Fields

| Field | Type | Description | Default |
| --------- | -------------------------------------------- | --------------------------------- | ------------- |
| `id` | `string` | Unique identifier for this recipe | Required |
| `name` | `string` | Descriptive name to use in the UI | Value of `id` |
| `method` | `string` | HTTP request method | Required |
| `url` | [`Template`](./template.md) | HTTP request URL | Required |
| `query` | [`mapping[string, Template]`](./template.md) | HTTP request query parameters | `{}` |
| `headers` | [`mapping[string, Template]`](./template.md) | HTTP request headers | `{}` |
| `body` | [`Template`](./template.md) | HTTP request body | `null` |
| Field | Type | Description | Default |
| --------- | -------------------------------------------- | --------------------------------- | ---------------------- |
| `name` | `string` | Descriptive name to use in the UI | Value of key in parent |
| `method` | `string` | HTTP request method | Required |
| `url` | [`Template`](./template.md) | HTTP request URL | Required |
| `query` | [`mapping[string, Template]`](./template.md) | HTTP request query parameters | `{}` |
| `headers` | [`mapping[string, Template]`](./template.md) | HTTP request headers | `{}` |
| `body` | [`Template`](./template.md) | HTTP request body | `null` |

## Examples

Expand Down
2 changes: 1 addition & 1 deletion docs/src/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Create a file called `slumber.yml` and add the following contents:

```yaml
requests:
- id: get
get:
method: GET
url: https://httpbin.org/get
```
Expand Down

0 comments on commit aa6439d

Please sign in to comment.