🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

mock-to-openapi

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-to-openapi

Cli tool (and library) for converting JSON mock objects to Open API schemas

1.2.1
latest
Source
npm
Version published
Weekly downloads
92
-22.03%
Maintainers
1
Weekly downloads
 
Created
Source

JSON mock to OpenAPI converter

NPM Downloads NPM Version NPM License Last Commit GitHub Workflow Status

Cli tool (and library) for converting JSON mock objects to OpenAPI schemas.

Install

npm install --global mock-to-openapi

Usage

Following command will convert all *.json files from directory ./examples to YAML OpenAPI schemas.

mock-to-openapi ./examples

Web Interface

You can use the online web interface to convert JSON mock objects to OpenAPI schemas directly in your browser:

https://ozzyczech.github.io/mock-to-openapi/

Example

Let's have, for example, json object with:

{
  "title": "This is title",
  "author": "Roman Ožana",
  "content": "This is just an example",
  "date": "2020-05-12T23:50:21.817Z"
}

Tool mock-to-openapi converts JSON to the OpenAPI specification as follows:

type: object
properties:
  title:
    type: string
    example: This is title
  author:
    type: string
    example: Roman Ožana
  content:
    type: string
    example: This is just an example
  date:
    type: string
    format: date-time
    example: 2020-05-12T23:50:21.817Z

Keywords

openapi

FAQs

Package last updated on 05 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts