MCPcopy Index your code
hub / github.com/OzzyCzech/mock-to-openapi

github.com/OzzyCzech/mock-to-openapi @v1.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.0 ↗ · + Follow
8 symbols 34 edges 10 files 1 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Core symbols most depended-on inside this repo

Shape

Function 8

Languages

TypeScript100%

Modules by API surface

src/get-format.js2 symbols
src/write-yaml.js1 symbols
src/to-open-api.js1 symbols
src/read-json.js1 symbols
src/main.js1 symbols
src/get-type.js1 symbols
cli.js1 symbols

For agents

$ claude mcp add mock-to-openapi \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page