PitchHut logo
Mock server for OpenAPI 3.0 with persistent state and a user-friendly web interface.
Pitch

Meridian is a powerful mock server designed for developers working with OpenAPI 3.0 specifications. It features persistent state management, request and response validation, and advanced capabilities like resource relationships and a built-in web interface for seamless API testing and inspection.

Description

Meridian is an advanced mock server designed to generate realistic API responses using OpenAPI 3.0 specifications. It features persistent state management, enabling data retention across server restarts, and operates with key functionalities that facilitate testing and development of APIs.

Key Features

  • Support for OpenAPI 3.0: Effortlessly parse your OpenAPI specification and receive accurate mock responses.
  • Persistent State Management: Utilize SQLite-based storage to maintain data integrity across restarts.
  • CRUD Operations: Automatically manage create, read, update, and delete operations.
  • Resource Relationships: Maintain referential integrity among resources.
  • Validation: Ensure incoming requests and outgoing responses adhere to defined specifications, enhancing reliability.
  • Seed Data: Easily initialize the server with predefined data sets for rapid testing.
  • Rate Limiting: Control request limits per client or globally, preventing abuse and managing traffic.
  • Error Simulation: Test client resilience by simulating random errors.
  • Response Caching: Enhance performance with ETag support and customizable cache time-to-live settings.
  • Gzip Compression: Automatically compress responses to improve bandwidth efficiency.
  • CORS Support: Configure cross-origin resource sharing as needed.
  • Latency Simulation: Introduce artificial delays to simulate slower network conditions.
  • Web Interface: Access a built-in web UI for easy state inspection and API testing.

In Development

Meridian is continually evolving, with planned enhancements including:

  • Advanced Data Generation: Incorporate pattern-based data generation with regex support and accommodate complex OpenAPI constructs.
  • Support for Nested Resources: Handle routes such as /users/{id}/posts for more complex scenarios.
  • Hot Reload: Enable a --watch flag for automatic server restarts on file changes, streamlining development.
  • WebSocket Support: Enhance real-time communication with WebSocket capabilities.

Usage Examples

After initializing a Meridian project, users can start the server and test the API using simple commands. For example:

# Start the server
meridian start

# List users
curl http://localhost:8080/users

# Create a user
curl -X POST http://localhost:8080/users \  
  -H "Content-Type: application/json" \  
  -d '{"id": "1", "name": "John Doe", "email": "john@example.com"}'

The web interface offers a straightforward way to inspect state and run API tests via http://localhost:8080/_meridian/. Users can view resources, send requests, and monitor the server's status.

Validation

Meridian includes built-in validation for requests and responses against the OpenAPI specification. This ensures that required fields, data types, and response schemas meet the defined standards, providing a robust testing environment.

For developers looking to streamline API testing, enhance reliability, and maintain essential state management, Meridian offers a comprehensive solution that improves the API development lifecycle.

0 comments

No comments yet.

Sign in to be the first to comment.