Giter VIP home page Giter VIP logo

ajv-schema-gen's Introduction

ajv-schema-gen

Generates basic AJV JSON schema based on JSON input

Purpose

The purpose of this schema generation tool is to be able to quickly define schemas for adding tests to Postman. Note the following constraints:

  • For array types, schema is only generated for the first instance in the array
  • Not all objects are the same; the JSON body you provide may not contain the entire schema, so check this beforehand

This is far from complete so make an issue or submit a PR for issues.

Installation and Usage

First make sure you have go installed and then run: go install github.com/deelawn/ajv-schema-gen/cmd/ajvgen

Then copy a JSON response to your clipboard and run the program as follows, saving the result to your clipboard: pbpaste | ajvgen | pbcopy

Inside a postman test start to define a schema: var schema = and paste after the equals sign to finish defining the schema with ajv output.

Then add code to run the schema comparison test

pm.test("validating schema", function() {
    pm.response.to.have.jsonSchema(schema);
});

ajv-schema-gen's People

Contributors

deelawn avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.