From aa6439dd8fd9aa16f91071763cb72d2b2f78cfdd Mon Sep 17 00:00:00 2001 From: Lucas Pickering Date: Wed, 6 Dec 2023 21:16:13 -0500 Subject: [PATCH] Update docs to remove `id` fields --- README.md | 2 +- docs/src/api/chain.md | 1 - docs/src/api/profile.md | 9 ++++----- docs/src/api/profile_value.md | 4 ++-- docs/src/api/request_collection.md | 30 +++++++++++++++--------------- docs/src/api/request_recipe.md | 17 ++++++++--------- docs/src/quick_start.md | 2 +- 7 files changed, 31 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index eef8c25f..edcc863c 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/docs/src/api/chain.md b/docs/src/api/chain.md index b5207354..f06bfac7 100644 --- a/docs/src/api/chain.md +++ b/docs/src/api/chain.md @@ -8,7 +8,6 @@ To use a chain in a template, reference it as `{{chains.}}`. | 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` | diff --git a/docs/src/api/profile.md b/docs/src/api/profile.md index b0fbc8a7..75249260 100644 --- a/docs/src/api/profile.md +++ b/docs/src/api/profile.md @@ -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 diff --git a/docs/src/api/profile_value.md b/docs/src/api/profile_value.md index 32f4ca49..bc97bbea 100644 --- a/docs/src/api/profile_value.md +++ b/docs/src/api/profile_value.md @@ -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}} ``` diff --git a/docs/src/api/request_collection.md b/docs/src/api/request_collection.md index 19557174..e5aa7806 100644 --- a/docs/src/api/request_collection.md +++ b/docs/src/api/request_collection.md @@ -27,12 +27,12 @@ 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 @@ -40,24 +40,24 @@ A request collection supports the following top-level fields: 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 @@ -68,8 +68,8 @@ base: &base Content-Type: application/json requests: - - <<: *base - id: login + login: + <<: *base method: POST url: "{{host}}/anything/login" body: | @@ -78,8 +78,8 @@ requests: "password": "{{chains.password}}" } - - <<: *base - id: Get User + get_user: + <<: *base method: GET url: "{{host}}/anything/current-user" query: diff --git a/docs/src/api/request_recipe.md b/docs/src/api/request_recipe.md index e8ff346d..9d675abf 100644 --- a/docs/src/api/request_recipe.md +++ b/docs/src/api/request_recipe.md @@ -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 diff --git a/docs/src/quick_start.md b/docs/src/quick_start.md index dfe564de..72aae0de 100644 --- a/docs/src/quick_start.md +++ b/docs/src/quick_start.md @@ -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 ```