openapi-to-postman-complete 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# OpenAPI to Postman Complete
|
|
2
|
+
|
|
3
|
+
> Complete OpenAPI to Postman converter. One command. Production-ready collections.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/openapi-to-postman-complete)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Why not just use openapi-to-postmanv2?
|
|
9
|
+
|
|
10
|
+
The official converter gives you valid Postman collections. We give you **usable** Postman collections.
|
|
11
|
+
|
|
12
|
+
Built on top of Postman's official `openapi-to-postmanv2` converter, adding:
|
|
13
|
+
|
|
14
|
+
- **Endpoint filtering** - Keep only what you need
|
|
15
|
+
- **Rich descriptions** - Human-friendly documentation
|
|
16
|
+
- **Real examples** - Actual request/response data
|
|
17
|
+
- **Environment variables** - Dynamic, reusable collections
|
|
18
|
+
- **Auto-generated tests** - Validation out of the box
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g openapi-to-postman-complete
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
openapi-to-postman-complete api.yaml config.yaml -o collection.json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
That's it. OpenAPI → production-ready Postman collection in one command.
|
|
33
|
+
|
|
34
|
+
No need to run `openapi-to-postmanv2` separately - we handle that internally.
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Create a `config.yaml` with what you need:
|
|
39
|
+
|
|
40
|
+
### Minimal
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
variables:
|
|
44
|
+
environment:
|
|
45
|
+
baseUrl: https://api.example.com
|
|
46
|
+
|
|
47
|
+
tests:
|
|
48
|
+
auto: true
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### With Filtering
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
filter:
|
|
55
|
+
include:
|
|
56
|
+
GET /users: true
|
|
57
|
+
POST /users: true
|
|
58
|
+
|
|
59
|
+
variables:
|
|
60
|
+
environment:
|
|
61
|
+
baseUrl: https://api.example.com
|
|
62
|
+
|
|
63
|
+
tests:
|
|
64
|
+
auto: true
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Full Example
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
filter:
|
|
71
|
+
include:
|
|
72
|
+
GET /pets: true
|
|
73
|
+
POST /pets: true
|
|
74
|
+
GET /pets/:id: true
|
|
75
|
+
|
|
76
|
+
descriptions:
|
|
77
|
+
collection:
|
|
78
|
+
Pet Store API:
|
|
79
|
+
name: Pet Store - Developer Collection
|
|
80
|
+
|
|
81
|
+
requests:
|
|
82
|
+
List pets: Get all pets from the store
|
|
83
|
+
|
|
84
|
+
examples:
|
|
85
|
+
responses:
|
|
86
|
+
List pets:
|
|
87
|
+
code: 200
|
|
88
|
+
body:
|
|
89
|
+
- id: '1'
|
|
90
|
+
name: Buddy
|
|
91
|
+
|
|
92
|
+
variables:
|
|
93
|
+
path:
|
|
94
|
+
id: '{{petId}}'
|
|
95
|
+
environment:
|
|
96
|
+
baseUrl: https://api.petstore.com
|
|
97
|
+
petId: '1'
|
|
98
|
+
|
|
99
|
+
tests:
|
|
100
|
+
auto: true
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
See [examples](./examples) for more.
|
|
104
|
+
|
|
105
|
+
## Programmatic Usage
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { enrichCollection } from '@openapi-to-postman-complete/core';
|
|
109
|
+
|
|
110
|
+
const collection = JSON.parse(readFileSync('collection.json', 'utf8'));
|
|
111
|
+
|
|
112
|
+
const enriched = enrichCollection(collection, {
|
|
113
|
+
variables: {
|
|
114
|
+
environment: { baseUrl: 'https://api.example.com' },
|
|
115
|
+
},
|
|
116
|
+
tests: { auto: true },
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Or load from YAML:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
const enriched = enrichCollection(collection, './config.yaml');
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-to-postman-complete",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Complete OpenAPI to Postman converter with filtering, descriptions, examples, variables, and auto-generated tests",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openapi",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"openapi-to-postman-complete": "./dist/index.js"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
|
-
"dist"
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md"
|
|
27
28
|
],
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"openapi-to-postmanv2": "^5.5.0",
|