- Added ruff and mypy installation to CI workflow - Removed deprecated license classifier from pyproject.toml - Added pytest conftest.py for proper test discovery - Fixed test paths in CI to match actual test file locations - All 46 tests pass locally
59 lines
879 B
Markdown
59 lines
879 B
Markdown
# MockAPI
|
|
|
|
OpenAPI Mock Server Generator - Generate functional mock APIs from OpenAPI 3.x specs
|
|
|
|
## Features
|
|
|
|
- Generate mock API servers from OpenAPI 3.x specifications
|
|
- Realistic random data generation based on JSON schemas
|
|
- Request validation against OpenAPI specs
|
|
- Response delay simulation
|
|
- Hot reload support for spec file changes
|
|
- Configurable via YAML or environment variables
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
pip install mockapi
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Validate an OpenAPI spec
|
|
|
|
```bash
|
|
mockapi validate openapi.yaml
|
|
```
|
|
|
|
### Start a mock server
|
|
|
|
```bash
|
|
mockapi start openapi.yaml --port 8080
|
|
```
|
|
|
|
### Show current configuration
|
|
|
|
```bash
|
|
mockapi show-config
|
|
```
|
|
|
|
## Configuration
|
|
|
|
Create a `mockapi.yaml` file:
|
|
|
|
```yaml
|
|
port: 8080
|
|
host: 0.0.0.0
|
|
delay: 100
|
|
seed: 42
|
|
```
|
|
|
|
Or use environment variables:
|
|
|
|
- `MOCKAPI_PORT`
|
|
- `MOCKAPI_HOST`
|
|
- `MOCKAPI_SEED`
|
|
|
|
## License
|
|
|
|
MIT License |