Nuns Playing Monopoly


    0.0.7 • Public • Published


    The purpose of this project is to work with the Pact project, and will compare a pact contract against a json-schema document. Examples of both a pact contract and the json-schema that it validates against are provided as examples.

    If you are working on a project where your backend team provides json-schema documents to provide validation of the API implementation, this project can be used to test your pact contracts. This is not quite as useful as doing full Pact contract validation, as the schema doesn't provide for specifications about how the API behaves under different circumstances (e.g. different query-parameters, different headers, different data seeding, etc), but it is better than nothing!

    How to do this

    1. Download sample complex output from your server for each endpoint

    Typically, if you visit your application in Chrome or Firefox and inspect the network traffic, you can perform a "copy as curl" operation, which should provide you with something like the following:

    curl ''

    If you run this curl command from your terminal and then pipe it through a JSON-beautifier such as jq, then you should have a pretty clean dump of some sample data that the server spits out.

    1. Write your JSON-schema to comply with the shape of the data that you found from the server. There are some samples of this for JSON-API in the /schema directory in this project if you'd like to get some inspiration.

    2. Validate that your json-schema file works with your downloaded sample data from your server.

    $ node_modules/.bin/ts-node bin/index.ts <schema-file> <captured-json-file>
    1. Generate a pact document.

    There is a number of ways to accomplish this. If you're using ember, you might use the ember-cli-pact addon, which analyzes mirage interactions and generates pact files.

    1. Compare the pact document with the schema files
    $ node_modules/.bin/ts-node bin/index.ts <pact-file>


    npm i @fastly/pact-schema-check

    DownloadsWeekly Downloads






    Unpacked Size

    185 kB

    Total Files


    Last publish


    • plindsay_fastly
    • bergieboy
    • alfonce
    • solomontang
    • drhoden-fastly
    • chicagoing
    • lgfastly
    • blane
    • triblondon
    • fgsch
    • leklund
    • pabergman
    • gschorkopf
    • andri_antonia
    • bernabas
    • philippschulte
    • thommahoney
    • psbanka
    • tundal45
    • lflores
    • rsouzafastly
    • patrickhamann
    • asergeyev
    • jasminedaly
    • cbuscher
    • akappen
    • hmorrison
    • jparrish
    • squeemishly
    • lturk
    • tomyoung
    • conniechu929
    • stevendaniels
    • briemarie
    • nilium
    • torch2424
    • hschaaf_fastly
    • johnmdonahue
    • alitorbati
    • uberfuzzyfastly
    • fashtley
    • mccurdyc
    • anachronism