All Projects → Fredx87 → Openapi Mock Generator

Fredx87 / Openapi Mock Generator

Licence: mit
Progressive Web App for generating mocked data from an OpenAPI specification

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Openapi Mock Generator

Openapi Mock
OpenAPI mock server with random data generation
Stars: ✭ 202 (+180.56%)
Mutual labels:  swagger, openapi, mock
Openapi Typescript Codegen
NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification
Stars: ✭ 249 (+245.83%)
Mutual labels:  swagger, openapi, generator
Openapi Backend
Build, Validate, Route, Authenticate and Mock using OpenAPI
Stars: ✭ 216 (+200%)
Mutual labels:  swagger, openapi, mock
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (+434.72%)
Mutual labels:  swagger, openapi, generator
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+4688.89%)
Mutual labels:  swagger, openapi, mock
Datamodel Code Generator
Pydantic model generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.
Stars: ✭ 393 (+445.83%)
Mutual labels:  swagger, openapi, generator
Easy Mock
A persistent service that generates mock data quickly and provids visualization view.
Stars: ✭ 8,644 (+11905.56%)
Mutual labels:  swagger, mock
Rolodex
📇API Documentation Generator for Phoenix
Stars: ✭ 34 (-52.78%)
Mutual labels:  swagger, openapi
Molten Boilerplate
A boilerplate for the molten framework by Bogdanp https://github.com/Bogdanp/molten
Stars: ✭ 50 (-30.56%)
Mutual labels:  swagger, openapi
Intellij Swagger
A plugin to help you easily edit Swagger and OpenAPI specification files inside IntelliJ IDEA
Stars: ✭ 1,073 (+1390.28%)
Mutual labels:  swagger, openapi
Spectral
A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v2 & v3.
Stars: ✭ 876 (+1116.67%)
Mutual labels:  swagger, openapi
Compojure Api
Sweet web apis with Compojure & Swagger
Stars: ✭ 1,056 (+1366.67%)
Mutual labels:  swagger, openapi
Oav
Tools for validating OpenAPI (Swagger) files.
Stars: ✭ 55 (-23.61%)
Mutual labels:  swagger, openapi
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+54883.33%)
Mutual labels:  swagger, openapi
Swagger2
Loading, parsing and validating requests to HTTP services based on Swagger v2.0 documents
Stars: ✭ 20 (-72.22%)
Mutual labels:  swagger, openapi
Paw Swaggerimporter
Swagger/OpenAPI 2.0 Importer for Paw
Stars: ✭ 34 (-52.78%)
Mutual labels:  swagger, openapi
Oval
oval: CLI for (O)penAPI Specification document (val)idation.
Stars: ✭ 15 (-79.17%)
Mutual labels:  swagger, openapi
Swagger Jsdoc
Generates swagger/openapi specification based on jsDoc comments and YAML files.
Stars: ✭ 1,057 (+1368.06%)
Mutual labels:  swagger, openapi
Azure Rest Api Specs
The source for REST API specifications for Microsoft Azure.
Stars: ✭ 1,104 (+1433.33%)
Mutual labels:  swagger, openapi
Openapi Generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
Stars: ✭ 10,634 (+14669.44%)
Mutual labels:  openapi, generator

OpenAPI Mock Generator

Create realistic mocked data from an OpenAPI specification, using faker.js and Chance random data generators.

GitHub Workflow Status Cypress.io tests Codecov GitHub release (latest SemVer) License

Go to app

Features

  • Support for OpenAPI 3.0 (and 2.0 with conversion to 3.0)
  • Generate realistic mocks for paths/schemas using JSON Schema properties (like format. minimum, maximum, etc...), faker.js or Chance data generators.
  • Autocomplete for OpenAPI properties, Faker.js methods, and Chance methods
  • Multiple projects support with data stored locally in the browser
  • Offline support

Usage

Once you have loaded an OpenApi specification, you can navigate the tree with paths and schemas, and load a definition in the editor. You can modify the selected definition and see the generated mocked data in the editor on the right. The modified definition will be taken also by other elements that have a reference to that definition.

In the tree, there is also a special Playground item that can be used to generate data "on the fly" without modifying an existing definition.

JSON Schema properties examples

Data can be generated from the format property:

{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date-time"
    },
    "uuid": {
      "type": "string",
      "format": "uuid"
    }
  }
}
{
  "date": "1986-09-22T16:44:15.119Z",
  "uuid": "daf0229f-cc3b-2b50-bbe4-6dea4837b0bf"
}

Number ranges can be controlled with minimum and maximum:

{
  "type": "integer",
  "minimum": 10,
  "maximum": 42
}
21

Array items length can be controlled with minItems and maxItems:

{
  "type": "array",
  "minItems": 5,
  "maxItems": 10,
  "items": {
    "type": "number"
  }
}
[
  71856238.93752578,
  -9957501.746244192,
  -7145041.207682312,
  -53358509.39871331,
  -83770088.68054512,
  -25448017.578881666,
  45764879.26211512,
  -5112859.453620076,
  -74878171.17192386,
  46948099.995764345
]

Faker.js and Chance methods

You can use the name of a faker.js or Chance method using the x-faker or x-chance properties:

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "x-chance": "company"
    },
    "description": {
      "type": "string",
      "x-faker": "company.catchPhrase"
    }
  }
}
{
  "name": "Citigroup, Inc",
  "description": "Vision-oriented foreground middleware"
}

You can pass parameters to the method using an object with the method name as a key and an array of values as parameters:

{
  "type": "object",
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "x-faker": {
        "date.between": ["2000", "2050"]
      }
    }
  }
}
{
  "date": "2040-05-06"
}

You can pass also object as a single parameter:

{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "x-chance": {
        "email": {
          "domain": "acme.com"
        }
      }
    }
  }
}
{
  "email": "[email protected]"
}

For Faker.js, you can interpolate multiple results with the fake method:

{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "x-faker": {
        "fake": ["{{name.lastName}}, {{name.firstName}} {{name.suffix}}"]
      }
    }
  }
}
{
  "name": "Schmeler, Odie Jr."
}

The code generation is based on json-schema-faker, you can also check the project documentation for other examples.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].