Skip to content

Commit 995298e

Browse files
committed
Refactor: Complete Postman YAML v3 migration cleanup
- Remove legacy JSON-only Postman tooling and scripts - Replace visualizer sync tool to operate on request YAML files - Update release workflow to sync CMTS collection from YAML folder - Rewrite import/user/tool docs for local-mode YAML source of truth - Add explicit Postman Desktop v12+ requirement in setup docs - Update install script command examples to YAML-based workflow - Remove remaining JSON collection references from repo guidance - Validate with sync checks, mkdocs strict build, and pytest suite - 2026-03-06 14:45:58
1 parent 6e98772 commit 995298e

15 files changed

Lines changed: 183 additions & 521 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
88
[![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-0A66C2)](https://pypnmapps.github.io/Postman-PyPNMApps-API/)
99

10-
This repository contains Postman collections, environment/globals files, and example visualizers for PyPNM API workflows.
10+
This repository contains Postman local-mode YAML collections, environment/globals files, and example visualizers for PyPNM API workflows.
1111

1212
It includes:
13-
- Postman collections (`PyPNM`, `PyPNM-CMTS`)
14-
- environment and globals exports
13+
- Postman collections (`PyPNM`, `PyPNM-CMTS`) as split YAML request files
14+
- environment and globals YAML files
1515
- `visual/` example Postman Visualizer HTML + JSON fixtures
1616

1717
## Basic Setup
1818

19-
1. Install Postman Desktop (Ubuntu/Windows): `docs/postman-install.md`
19+
1. Install Postman Desktop v12+ (Ubuntu/Windows): `docs/postman-install.md`
2020
2. Clone this repository:
2121

2222
```bash

docs/docs-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This directory contains user documentation for working with the Postman PyPNMApp
66

77
- `docs/postman-install.md` - Postman Desktop download/install steps for Ubuntu and Windows.
88
- `docs/postman-import-and-navigation.md` - Import Postman files, configure globals, and navigate collections.
9-
- `docs/postman-collection-format.md` - Format Postman collection JSON consistently on Windows/Linux.
9+
- `docs/postman-collection-format.md` - Postman local YAML conventions and migration notes.
1010
- `docs/user-guide.md` - End-user setup and Postman import/use instructions.
1111
- `docs/tools.md` - Local developer tooling (`sanitize`, `bump_version`, `release`, `git-save`, `git-push`).
1212
- `docs/visual-workflow.md` - Simple workflow for editing visuals and syncing Postman visualizer scripts.

docs/postman-collection-format.md

Lines changed: 24 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,40 @@
1-
# Postman Collection Formatting
1+
# Postman Local YAML Format
22

3-
Use the Postman collection formatter to normalize `postman/collections/PyPNM.postman_collection.json` across Linux and Windows.
3+
This repository uses Postman local-mode YAML artifacts as the source of truth.
44

5-
It provides:
5+
## Paths
66

7-
- consistent JSON formatting (default: 2-space indent)
8-
- LF line endings (`\n`)
9-
- schema version detection (`v2.0` / `v2.1`)
10-
- normalization of non-finite numeric values (`NaN` / `Infinity`) to `null` for valid JSON output
7+
- Collections: `postman/collections/<collection>/.../*.request.yaml`
8+
- Environments: `postman/environments/*.environment.yaml`
9+
- Globals: `postman/globals/*.globals.yaml`
1110

12-
## Setup
11+
## Required Conventions
1312

14-
Create and activate the repo virtual environment:
13+
- Keep one request per file (`*.request.yaml`).
14+
- Preserve folder hierarchy under each collection directory.
15+
- Keep request `name` human-friendly; keep filename filesystem-safe.
16+
- Keep Postman variables as literal `{{var}}`.
17+
- Use quoted strings when needed to avoid YAML type coercion.
18+
- Prefer multiline block style for long scripts/bodies.
1519

16-
```bash
17-
./install.sh
18-
source .venv/bin/activate
19-
```
20-
21-
If you want Linux/macOS command examples from the installer output, use:
22-
23-
```bash
24-
./install.sh --os-linux
25-
```
26-
27-
## Windows (PowerShell) - Default
28-
29-
Formatter wrapper:
30-
31-
- `tools/postman/format_collection.ps1`
32-
33-
Check formatting only:
34-
35-
```powershell
36-
.\tools\postman\format_collection.ps1 -Check
37-
```
38-
39-
Apply formatting:
40-
41-
```powershell
42-
.\tools\postman\format_collection.ps1 -Fix
43-
```
44-
45-
Compact/minified output (optional):
46-
47-
```powershell
48-
.\tools\postman\format_collection.ps1 -Fix -Compact
49-
```
50-
51-
## Linux / macOS (Shell)
52-
53-
Formatter wrapper:
20+
## Visualizer Script Sync
5421

55-
- `tools/postman/format_collection.sh`
56-
57-
If needed, make sure the shell wrapper is executable:
58-
59-
```bash
60-
chmod +x tools/postman/format_collection.sh
61-
```
62-
63-
Check formatting only (no file changes):
22+
Use this tool to check/update embedded visualizer script code:
6423

6524
```bash
66-
tools/postman/format_collection.sh --check
67-
```
68-
69-
Apply formatting:
70-
71-
```bash
72-
tools/postman/format_collection.sh --fix
73-
```
74-
75-
Compact/minified output (optional):
76-
77-
```bash
78-
tools/postman/format_collection.sh --fix --compact
25+
source .venv/bin/activate
26+
tools/postman/sync_visualizers.py --check
27+
tools/postman/sync_visualizers.py --update
7928
```
8029

81-
## Alternate Collection Path
82-
83-
Both wrappers support formatting a different collection file (for example `PyPNM-CMTS`).
84-
85-
Linux / macOS:
30+
For `PyPNM-CMTS`:
8631

8732
```bash
88-
tools/postman/format_collection.sh --path postman/collections/PyPNM-CMTS.postman_collection.json --fix
89-
```
90-
91-
Windows PowerShell:
92-
93-
```powershell
94-
.\tools\postman\format_collection.ps1 -Path postman/collections/PyPNM-CMTS.postman_collection.json -Fix
33+
source .venv/bin/activate
34+
tools/postman/sync_visualizers.py --check --collection postman/collections/PyPNM-CMTS --visual-root visual/PyPNM-CMTS
35+
tools/postman/sync_visualizers.py --update --collection postman/collections/PyPNM-CMTS --visual-root visual/PyPNM-CMTS
9536
```
9637

97-
## Recommended Usage
98-
99-
Run formatting before commit when the collection JSON changes:
38+
## Migration Note
10039

101-
1. Format collection:
102-
- `.\tools\postman\format_collection.ps1 -Fix`
103-
2. Sync visualizer scripts (if visual HTML changed):
104-
- `tools/postman/sync_visualizers.py --update`
105-
3. Regenerate visual docs (if visual HTML/JSON changed):
106-
- `tools/docs/build_visual_docs.py`
40+
Legacy single-file Postman collection JSON exports are not the primary artifact in this repo. Prefer editing YAML request files directly.

docs/postman-import-and-navigation.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,68 @@
22

33
Use this guide after installing Postman and cloning the repository.
44

5-
## Import Files Into Postman
5+
Required Postman version: **Postman Desktop v12+**.
66

7-
In Postman, import the following files:
7+
## Local-Mode Source of Truth
88

9-
- [`postman/collections/PyPNM.postman_collection.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/collections/PyPNM.postman_collection.json)
10-
- [`postman/collections/PyPNM-CMTS.postman_collection.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/collections/PyPNM-CMTS.postman_collection.json)
11-
- [`postman/environments/PyPNM Remote Server.postman_environment.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/environments/PyPNM%20Remote%20Server.postman_environment.json)
12-
- [`postman/globals/workspace.postman_globals.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/globals/workspace.postman_globals.json)
9+
This repository uses Postman local-mode file artifacts:
1310

14-
Recommended import flow:
11+
- Collections: `postman/collections/<collection>/.../*.request.yaml`
12+
- Environments: `postman/environments/*.environment.yaml`
13+
- Globals: `postman/globals/*.globals.yaml`
14+
15+
Do not expect a single `*.postman_collection.json` export as the primary source.
16+
17+
## Open In Postman
18+
19+
Recommended flow:
1520

1621
1. Open Postman Desktop
17-
2. Click `Import`
18-
3. Select `Files`
19-
4. Choose the files listed above
20-
5. Confirm import
22+
2. Use local mode / open workspace from your cloned repository
23+
3. Point Postman to this repository root so it can read `postman/` YAML artifacts
2124

22-
## Configure Base URL / Globals
25+
## Configure Base URL / Variables
2326

24-
Set `pypnm_url` in Postman Globals.
27+
Set `pypnm_url` in globals (or equivalent environment variable if your workspace uses environment scope).
2528

2629
Example:
2730

2831
- `http://127.0.0.1:8000`
2932

3033
Important:
3134

32-
- Collection requests use `{{pypnm_url}}` (global variable)
33-
- The provided environment file includes `base_url`
34-
- If you prefer environment-only configuration, update the collection requests to use `{{base_url}}`
35+
- Request URLs in this repo use `{{pypnm_url}}` by default.
36+
- Keep variable syntax in Postman form (`{{var}}`).
3537

36-
## Navigate the Imported Content
38+
## Navigate Main Collections
3739

38-
### Collections
40+
- `postman/collections/PyPNM/`
41+
- `postman/collections/PyPNM-CMTS/`
3942

40-
- `PyPNM` (primary collection)
41-
- `PyPNM-CMTS` (placeholder shell)
42-
43-
### Good First Request
43+
## Good First Request
4444

4545
Use a simple health check first:
4646

47-
1. Open [`PyPNM` collection](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/collections/PyPNM.postman_collection.json)
48-
2. Open `Health` folder
49-
3. Open `Health` request
47+
1. Open collection `PyPNM`
48+
2. Open folder `Health`
49+
3. Open request `Health.request.yaml` (`name: Health`)
5050
4. Confirm `pypnm_url` is set
5151
5. Click `Send`
5252

53-
### Common Next Areas
53+
## Common Next Areas
5454

5555
- `SingleCapture` for single-capture workflows and visualizers
5656
- `MultiCapture` for multi-capture operations and analysis flows
57-
- `FileManager` for file workflow endpoints
57+
- `PNM/Files` for file workflow endpoints
5858
- `System` / `Health` for service checks and system actions
5959

60-
## Troubleshooting Import Setup
60+
## Troubleshooting
61+
62+
- If variables appear unresolved, confirm globals/environment YAML loaded in local mode.
63+
- If requests fail immediately, verify `pypnm_url` and authentication-related variables.
64+
- If visual output looks stale, run:
6165

62-
- If requests fail immediately, confirm `pypnm_url` is set in [Globals (`workspace.postman_globals.json`)](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/globals/workspace.postman_globals.json)
63-
- If variables appear unresolved, verify [`workspace.postman_globals.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/globals/workspace.postman_globals.json) imported successfully
64-
- If you use the environment value (`base_url`) instead, verify the imported environment [`PyPNM Remote Server.postman_environment.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/environments/PyPNM%20Remote%20Server.postman_environment.json) and ensure request URLs in [`PyPNM.postman_collection.json`](https://github.com/PyPNMApps/Postman-PyPNMApps-API/blob/main/postman/collections/PyPNM.postman_collection.json) were updated from `{{pypnm_url}}`
66+
```bash
67+
source .venv/bin/activate
68+
tools/postman/sync_visualizers.py --check
69+
```

docs/postman-install.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Install Postman Desktop (Ubuntu and Windows)
22

3+
## Required Version
4+
5+
- Use **Postman Desktop v12 or newer** for this repository.
6+
- This repo uses local-mode YAML collections (`*.request.yaml`) aligned with Postman Collection v3 workflows.
7+
38
## Download
49

510
- Official Postman downloads page: `https://www.postman.com/downloads/`

docs/tools.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Project utilities live under `tools/` to keep the repository root clean.
55
See also:
66

77
- `docs/visual-workflow.md` for the recommended visual edit -> Postman sync -> docs workflow
8-
- `docs/postman-collection-format.md` for Postman collection JSON formatting (Windows-first usage)
8+
- `docs/postman-collection-format.md` for local YAML Postman conventions and migration notes
99

1010
## Setup
1111

@@ -80,9 +80,9 @@ Path:
8080

8181
Purpose:
8282

83-
- Syncs Postman collection visualizer test scripts from `visual/PyPNM/**/*.html`
84-
- Treats Postman request paths/names as the source of truth for matching visual HTML paths
85-
- Detects drift between `visual/` HTML and `postman/collections/PyPNM.postman_collection.json`
83+
- Syncs Postman request visualizer scripts from `visual/**/*.html` into local YAML request files
84+
- Treats request header mapping (`// Postman Visualizer: ...`) as source for HTML path resolution
85+
- Detects drift between `visual/` HTML and `postman/collections/**/.request.yaml`
8686

8787
Usage:
8888

@@ -93,36 +93,8 @@ tools/postman/sync_visualizers.py --update
9393

9494
Modes:
9595

96-
- `--check` : read-only, exits non-zero if collection visualizer scripts drift from `visual/`
97-
- `--update` : updates collection visualizer scripts in place from matched HTML files
98-
99-
## Postman Collection Formatter
100-
101-
Paths:
102-
103-
- `tools/postman/format_collection.py`
104-
- `tools/postman/format_collection.sh`
105-
- `tools/postman/format_collection.ps1`
106-
107-
Purpose:
108-
109-
- Formats Postman collection JSON with consistent style and LF line endings
110-
- Detects Postman collection schema version (`v2.0` / `v2.1`)
111-
- Normalizes non-finite values (`NaN` / `Infinity`) to `null` for valid JSON output
112-
113-
Windows (default examples):
114-
115-
```powershell
116-
.\tools\postman\format_collection.ps1 -Check
117-
.\tools\postman\format_collection.ps1 -Fix
118-
```
119-
120-
Linux/macOS:
121-
122-
```bash
123-
tools/postman/format_collection.sh --check
124-
tools/postman/format_collection.sh --fix
125-
```
96+
- `--check` : read-only, exits non-zero if visualizer scripts drift from `visual/`
97+
- `--update` : updates request YAML `scripts[].code` from matched HTML files
12698

12799
## Version Bump Tool
128100

docs/user-guide.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22

33
## Overview
44

5-
This repository provides Postman collections, environment, globals, and visualizer examples for PyPNM API workflows.
5+
This repository provides Postman local-mode artifacts and visualizer examples for PyPNM API workflows.
6+
7+
Required Postman version: **Postman Desktop v12+** (local YAML collection support).
68

79
Main artifacts:
810

9-
- `postman/collections/PyPNM.postman_collection.json`
10-
- `postman/collections/PyPNM-CMTS.postman_collection.json` (placeholder shell)
11-
- `postman/environments/PyPNM Remote Server.postman_environment.json`
12-
- `postman/globals/workspace.postman_globals.json`
11+
- `postman/collections/PyPNM/**.request.yaml`
12+
- `postman/collections/PyPNM-CMTS/**.request.yaml`
13+
- `postman/environments/PyPNM Remote Server.environment.yaml`
14+
- `postman/globals/workspace.globals.yaml`
1315

1416
## Install Postman
1517

16-
1. Follow `docs/postman-install.md` for Ubuntu/Windows download and install steps
18+
1. Follow `docs/postman-install.md` for Ubuntu/Windows install steps
1719
2. Install and open Postman
1820

1921
## Clone Repository
@@ -23,17 +25,17 @@ git clone https://github.com/PyPNMApps/Postman-PyPNMApps-API.git
2325
cd Postman-PyPNMApps-API
2426
```
2527

26-
## Import Into Postman
28+
## Load Postman Assets
2729

2830
Follow `docs/postman-import-and-navigation.md` for:
2931

30-
- importing collections/environment/globals
32+
- opening local-mode YAML collections/environment/globals
3133
- configuring `pypnm_url`
3234
- navigating the `PyPNM` collection and first request
3335

3436
## Configure URL and Variables
3537

36-
Minimum globals commonly needed:
38+
Minimum variables commonly needed:
3739

3840
- `pypnm_url`
3941
- `cm_ip_address`
@@ -62,7 +64,7 @@ Health check:
6264
2. Set `pypnm_url`
6365
3. Click `Send`
6466

65-
Then try a single capture request such as `Ofdm-RxMER-GetCapture`.
67+
Then try a single-capture request such as `Ofdm-RxMER-GetCapture`.
6668

6769
## Visualizer Notes
6870

0 commit comments

Comments
 (0)