A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/muonsoft/openapi-mock below:

muonsoft/openapi-mock: OpenAPI mock server with random data generation

OpenAPI API mock server with random data generation by specified schemas.

Feature Support status generating xml response basic support (without xml tags) generating json response supported generation of basic types supported generation of enums supported generation of associative arrays supported generation of combined types supported (without tag not and discriminator) local reference resolving supported remote reference resolving not supported URL reference resolving not supported validating request data not supported force using custom response schema not supported (schema detected automatically)

Download latest binary and run a server.

# runs a local server on port 8080
./openapi-mock serve --specification-url https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml

# to test that the server successfully ran
curl 'http://localhost:8080/v1/pets'

Alternatively, you can use Docker image.

# downloads an image
docker pull muonsoft/openapi-mock

# runs a docker container with exported port 8080
docker run -p 8080:8080 -e "OPENAPI_MOCK_SPECIFICATION_URL=https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml" --rm muonsoft/openapi-mock

# to test that the server successfully ran
curl 'http://localhost:8080/v1/pets'

Also, you can use Docker Compose. Example of docker-compose.yml

version: '3.0'

services:
  openapi_mock:
    container_name: openapi_mock
    image: muonsoft/openapi-mock
    environment:
      OPENAPI_MOCK_SPECIFICATION_URL: 'https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml'
    ports:
      - "8080:8080"

To start up a container run command.

If you want to reference a local file in docker compose:

version: '3.0'

services:
  openapi_mock:
    container_name: openapi_mock
    image: muonsoft/openapi-mock
    volumes:
    - ./openapi:/etc/openapi
    environment:
      OPENAPI_MOCK_SPECIFICATION_URL: '/etc/openapi/petstore.yaml'
    ports:
      - "8080:8080"

This project is licensed under the MIT License - see the LICENSE file for details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4