Skip to content

Commit 1f5678b

Browse files
committed
closes #70: updates scapi schemas doc
1 parent 90cc338 commit 1f5678b

4 files changed

Lines changed: 61 additions & 61 deletions

File tree

docs/cli/scapi-schemas.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ b2c scapi schemas list --tenant-id <TENANT_ID>
5454
| Flag | Description | Default |
5555
|------|-------------|---------|
5656
| `--tenant-id` | (Required) Organization/tenant ID | |
57-
| `--api-family` | Filter by API family (e.g., shopper, admin) | |
58-
| `--api-name` | Filter by API name (e.g., products, orders) | |
57+
| `--api-family` | Filter by API family (e.g., product, checkout, search) | |
58+
| `--api-name` | Filter by API name (e.g., shopper-products, shopper-baskets) | |
5959
| `--api-version` | Filter by API version (e.g., v1) | |
6060
| `--status`, `-s` | Filter by schema status (`current`, `deprecated`) | |
6161
| `--columns`, `-c` | Columns to display (comma-separated) | |
@@ -75,10 +75,10 @@ Extended columns (shown with `--extended`): `schemaVersion`, `link`
7575
b2c scapi schemas list --tenant-id zzxy_prd
7676

7777
# Filter by API family
78-
b2c scapi schemas list --tenant-id zzxy_prd --api-family shopper
78+
b2c scapi schemas list --tenant-id zzxy_prd --api-family product
7979

8080
# Filter by API name
81-
b2c scapi schemas list --tenant-id zzxy_prd --api-name products
81+
b2c scapi schemas list --tenant-id zzxy_prd --api-name shopper-products
8282

8383
# Filter by status
8484
b2c scapi schemas list --tenant-id zzxy_prd --status current
@@ -98,12 +98,12 @@ Default table output:
9898
```
9999
Found 15 schema(s):
100100
101-
API Family API Name Version Status
102-
──────────────────────────────────────────
103-
shopper products v1 current
104-
shopper orders v1 current
105-
shopper customers v1 current
106-
admin inventory v1 current
101+
API Family API Name Version Status
102+
───────────────────────────────────────────────
103+
product shopper-products v1 current
104+
checkout shopper-baskets v2 current
105+
search shopper-search v1 current
106+
customer shopper-customers v1 current
107107
...
108108
```
109109

@@ -123,8 +123,8 @@ b2c scapi schemas get <apiFamily> <apiName> <apiVersion> --tenant-id <TENANT_ID>
123123

124124
| Argument | Description |
125125
|----------|-------------|
126-
| `apiFamily` | API family (e.g., shopper, admin) |
127-
| `apiName` | API name (e.g., products, orders) |
126+
| `apiFamily` | API family (e.g., product, checkout, search) |
127+
| `apiName` | API name (e.g., shopper-products, shopper-baskets) |
128128
| `apiVersion` | API version (e.g., v1) |
129129

130130
### Flags
@@ -148,72 +148,72 @@ b2c scapi schemas get <apiFamily> <apiName> <apiVersion> --tenant-id <TENANT_ID>
148148

149149
By default, schemas are output in a collapsed/outline format optimized for context efficiency (ideal for agentic use cases and LLM consumption):
150150

151-
- **Paths**: Show only HTTP methods available: `{"/products": ["get", "post"]}`
152-
- **Schemas**: Show only schema names: `{"Product": {}, "Order": {}}`
153-
- **Examples**: Show only example names: `{"ProductExample": {}}`
151+
- **Paths**: Show only HTTP methods available: `{"/products": ["get"], "/products/{id}": ["get"]}`
152+
- **Schemas**: Show only schema names: `{"Product": {}, "ProductResult": {}}`
153+
- **Examples**: Show only example names: `{"product-example": {}}`
154154

155155
Use the `--expand-*` flags for selective expansion or `--expand-all` for the full, unmodified schema.
156156

157157
### Examples
158158

159159
```bash
160160
# Get collapsed/outline schema (default - context efficient)
161-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd
161+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
162162

163163
# Get full schema without collapsing
164-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-all
164+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-all
165165

166166
# Expand specific paths only
167-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{id}
167+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{productId}
168168

169169
# Expand specific schemas only
170-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-schemas Product,SearchResult
170+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-schemas Product,ProductResult
171171

172172
# Expand specific examples only
173-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-examples ProductExample
173+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-examples product-example
174174

175175
# Combine selective expansions
176-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
176+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
177177

178178
# List available paths in the schema
179-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --list-paths
179+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-paths
180180

181181
# List available schema names
182-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --list-schemas
182+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-schemas
183183

184184
# List available examples
185-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --list-examples
185+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-examples
186186

187187
# Output as YAML
188-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --yaml
188+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml
189189

190190
# Output wrapped JSON with metadata
191-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --json
191+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --json
192192

193193
# Disable custom properties expansion
194-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --no-expand-custom-properties
194+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --no-expand-custom-properties
195195
```
196196

197197
### Output Formats
198198

199199
**Default (raw JSON to stdout)**: The schema is output directly to stdout as JSON. Use shell redirection to save to a file:
200200

201201
```bash
202-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd > schema.json
202+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json
203203
```
204204

205205
**YAML format (`--yaml`)**: Output as YAML for readability:
206206

207207
```bash
208-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --yaml > schema.yaml
208+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml > schema.yaml
209209
```
210210

211211
**Wrapped JSON (`--json`)**: Output includes metadata wrapper:
212212

213213
```json
214214
{
215-
"apiFamily": "shopper",
216-
"apiName": "products",
215+
"apiFamily": "product",
216+
"apiName": "shopper-products",
217217
"apiVersion": "v1",
218218
"schema": { ... }
219219
}

packages/b2c-cli/src/commands/scapi/schemas/get.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ interface GetOutput {
3434
export default class ScapiSchemasGet extends ScapiSchemasCommand<typeof ScapiSchemasGet> {
3535
static args = {
3636
apiFamily: Args.string({
37-
description: t('args.apiFamily.description', 'API family (e.g., shopper, admin)'),
37+
description: t('args.apiFamily.description', 'API family (e.g., product, checkout, search)'),
3838
required: true,
3939
}),
4040
apiName: Args.string({
41-
description: t('args.apiName.description', 'API name (e.g., products, orders)'),
41+
description: t('args.apiName.description', 'API name (e.g., shopper-products, shopper-baskets)'),
4242
required: true,
4343
}),
4444
apiVersion: Args.string({
@@ -56,19 +56,19 @@ export default class ScapiSchemasGet extends ScapiSchemasCommand<typeof ScapiSch
5656

5757
static examples = [
5858
// Basic usage
59-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd',
59+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd',
6060
// Full schema
61-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --expand-all',
61+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --expand-all',
6262
// Selective expansion
63-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --expand-paths /products',
64-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --expand-schemas Product,SearchResult',
63+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --expand-paths /products',
64+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --expand-schemas Product,ProductResult',
6565
// List available paths/schemas
66-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --list-paths',
67-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --list-schemas',
66+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --list-paths',
67+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --list-schemas',
6868
// YAML output
69-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --yaml',
69+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --yaml',
7070
// JSON wrapped output
71-
'<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --json',
71+
'<%= config.bin %> <%= command.id %> product shopper-products v1 --tenant-id f_ecom_zzxy_prd --json',
7272
];
7373

7474
static flags = {

packages/b2c-cli/src/commands/scapi/schemas/list.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export default class ScapiSchemasList extends ScapiSchemasCommand<typeof ScapiSc
6161

6262
static examples = [
6363
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd',
64-
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --api-family shopper',
65-
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --api-name products',
64+
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --api-family product',
65+
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --api-name shopper-products',
6666
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --status current',
6767
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --extended',
6868
'<%= config.bin %> <%= command.id %> --tenant-id f_ecom_zzxy_prd --json',
@@ -71,10 +71,10 @@ export default class ScapiSchemasList extends ScapiSchemasCommand<typeof ScapiSc
7171
static flags = {
7272
...ScapiSchemasCommand.baseFlags,
7373
'api-family': Flags.string({
74-
description: t('flags.apiFamily.description', 'Filter by API family (e.g., shopper, admin)'),
74+
description: t('flags.apiFamily.description', 'Filter by API family (e.g., product, checkout, search)'),
7575
}),
7676
'api-name': Flags.string({
77-
description: t('flags.apiName.description', 'Filter by API name (e.g., products, orders)'),
77+
description: t('flags.apiName.description', 'Filter by API name (e.g., shopper-products, shopper-baskets)'),
7878
}),
7979
'api-version': Flags.string({
8080
description: t('flags.apiVersion.description', 'Filter by API version (e.g., v1)'),

plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ b2c scapi schemas list --tenant-id zzxy_prd --json
4242
### Filter Schemas
4343

4444
```bash
45-
# filter by API family (shopper or admin)
46-
b2c scapi schemas list --tenant-id zzxy_prd --api-family shopper
45+
# filter by API family (e.g., product, checkout, search)
46+
b2c scapi schemas list --tenant-id zzxy_prd --api-family product
4747

4848
# filter by API name
49-
b2c scapi schemas list --tenant-id zzxy_prd --api-name products
49+
b2c scapi schemas list --tenant-id zzxy_prd --api-name shopper-products
5050

5151
# filter by status
5252
b2c scapi schemas list --tenant-id zzxy_prd --status current
@@ -58,10 +58,10 @@ By default, schemas are output in a collapsed format optimized for context effic
5858

5959
```bash
6060
# get collapsed schema (paths show methods, schemas show names only)
61-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd
61+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
6262

6363
# save to file
64-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd > schema.json
64+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd > schema.json
6565
```
6666

6767
### Get Schema with Selective Expansion
@@ -70,20 +70,20 @@ Expand only the parts of the schema you need:
7070

7171
```bash
7272
# expand specific paths
73-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{id}
73+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products,/products/{productId}
7474

7575
# expand specific schemas
76-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-schemas Product,SearchResult
76+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-schemas Product,ProductResult
7777

7878
# combine expansions
79-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
79+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-paths /products --expand-schemas Product
8080
```
8181

8282
### Get Full Schema
8383

8484
```bash
8585
# get full schema without any collapsing
86-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --expand-all
86+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --expand-all
8787
```
8888

8989
### List Available Paths/Schemas/Examples
@@ -92,33 +92,33 @@ Discover what's available in a schema before expanding:
9292

9393
```bash
9494
# list all paths in the schema
95-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --list-paths
95+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-paths
9696

9797
# list all schema names
98-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --list-schemas
98+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-schemas
9999

100100
# list all examples
101-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --list-examples
101+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --list-examples
102102
```
103103

104104
### Output Formats
105105

106106
```bash
107107
# output as YAML
108-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --yaml
108+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --yaml
109109

110110
# output wrapped JSON with metadata (apiFamily, apiName, apiVersion, schema)
111-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --json
111+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --json
112112
```
113113

114114
### Custom Properties
115115

116116
```bash
117117
# include custom properties (default behavior)
118-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd
118+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd
119119

120120
# exclude custom properties
121-
b2c scapi schemas get shopper products v1 --tenant-id zzxy_prd --no-expand-custom-properties
121+
b2c scapi schemas get product shopper-products v1 --tenant-id zzxy_prd --no-expand-custom-properties
122122
```
123123

124124
### Configuration

0 commit comments

Comments
 (0)