PHPackages                             micro-module/postman-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. micro-module/postman-generator

ActiveLibrary

micro-module/postman-generator
==============================

Generate Postman collections from OpenAPI specifications

v0.1.0(1mo ago)01↑2900%MITPHPPHP ^8.4

Since Mar 28Pushed 1mo agoCompare

[ Source](https://github.com/temafey/micro_modules_postman_generator)[ Packagist](https://packagist.org/packages/micro-module/postman-generator)[ RSS](/packages/micro-module-postman-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

MicroModule Postman Generator
=============================

[](#micromodule-postman-generator)

Generate Postman collections and environments from OpenAPI (Swagger) specifications.

Features
--------

[](#features)

- **OpenAPI Parsing**: Extract endpoints, schemas, and parameters from OpenAPI 3.0 specs
- **Collection Generation**: Build Postman v2.1 collections with folders, requests, and examples
- **Environment Generation**: Create Postman environments with base URLs and auth variables
- **Request Building**: Construct request bodies, headers, and query params from OpenAPI schemas
- **File Export**: Write collections and environments to JSON files
- **CLI Command**: Symfony console command for automated generation

Installation
------------

[](#installation)

```
composer require --dev micro-module/postman-generator
```

Usage
-----

[](#usage)

### CLI Command

[](#cli-command)

```
bin/console postman:generate \
    --openapi-url=http://localhost/api/v1/docs.json \
    --output-dir=tests/postman \
    --collection-name="My API" \
    --base-url="{{base_url}}"
```

### Programmatic Usage

[](#programmatic-usage)

```
use MicroModule\PostmanGenerator\PostmanGeneratorService;
use MicroModule\PostmanGenerator\OpenApi\OpenApiParser;
use MicroModule\PostmanGenerator\PostmanCollectionFactory;
use MicroModule\PostmanGenerator\PostmanEnvironmentGenerator;
use MicroModule\PostmanGenerator\PostmanRequestBuilder;
use MicroModule\PostmanGenerator\CollectionFileWriter;

$generator = new PostmanGeneratorService(
    new OpenApiParser(),
    new PostmanCollectionFactory(new PostmanRequestBuilder()),
    new PostmanEnvironmentGenerator(),
    new CollectionFileWriter()
);

$generator->generate(
    openApiUrl: 'http://localhost/api/v1/docs.json',
    outputDir: 'tests/postman',
    collectionName: 'My API',
    baseUrl: '{{base_url}}'
);
```

Architecture
------------

[](#architecture)

```
OpenAPI Spec (JSON)
    └── OpenApiParser
            └── Parsed endpoints, schemas, parameters
                    ├── PostmanCollectionFactory
                    │       └── PostmanRequestBuilder (per endpoint)
                    │               └── Postman Collection JSON
                    └── PostmanEnvironmentGenerator
                            └── Postman Environment JSON

CollectionFileWriter → writes both to disk
PostmanGeneratorService → orchestrates the full pipeline

```

Key Classes
-----------

[](#key-classes)

ClassPurpose`PostmanGeneratorService`Main orchestrator for the generation pipeline`OpenApiParser`Parses OpenAPI 3.0 JSON specs into structured data`PostmanCollectionFactory`Builds Postman v2.1 collection structure`PostmanRequestBuilder`Constructs individual request items from endpoints`PostmanEnvironmentGenerator`Creates Postman environment with variables`CollectionFileWriter`Writes collection/environment JSON to files`GeneratePostmanCollectionCommand`Symfony console commandOutput Format
-------------

[](#output-format)

### Collection (Postman v2.1)

[](#collection-postman-v21)

```
{
    "info": {
        "name": "My API",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "News",
            "item": [
                {
                    "name": "Create News",
                    "request": {
                        "method": "POST",
                        "url": "{{base_url}}/api/v1/news",
                        "header": [...],
                        "body": { "mode": "raw", "raw": "..." }
                    }
                }
            ]
        }
    ]
}
```

### Environment

[](#environment)

```
{
    "name": "My API - Local",
    "values": [
        { "key": "base_url", "value": "http://localhost:8088", "enabled": true },
        { "key": "bearer_token", "value": "", "enabled": true }
    ]
}
```

Requirements
------------

[](#requirements)

- PHP 8.4+

### Optional (for CLI command)

[](#optional-for-cli-command)

- `symfony/console` ^7.0 or ^8.0
- `symfony/http-kernel` ^7.0 or ^8.0
- `symfony/http-foundation` ^7.0 or ^8.0

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb0e6b6ff14b9d53d413617c42ddb1f83ff451c32beac02bc4ebebb6cfabeb00?d=identicon)[temafey](/maintainers/temafey)

---

Top Contributors

[![temafey](https://avatars.githubusercontent.com/u/981101?v=4)](https://github.com/temafey "temafey (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/micro-module-postman-generator/health.svg)

```
[![Health](https://phpackages.com/badges/micro-module-postman-generator/health.svg)](https://phpackages.com/packages/micro-module-postman-generator)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
