{"id":13469622,"url":"https://github.com/stoplightio/prism","last_synced_at":"2025-05-12T05:33:24.142Z","repository":{"id":37550077,"uuid":"54172257","full_name":"stoplightio/prism","owner":"stoplightio","description":"Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.","archived":false,"fork":false,"pushed_at":"2025-04-17T13:35:49.000Z","size":13693,"stargazers_count":4547,"open_issues_count":111,"forks_count":371,"subscribers_count":54,"default_branch":"master","last_synced_at":"2025-05-12T02:50:26.597Z","etag":null,"topics":["api-testing","cli","hacktoberfest","http-proxy","mock-server","mocking","oas","openapi","openapi3","postman-collection","prism","swagger"],"latest_commit_sha":null,"homepage":"https://stoplight.io/open-source/prism","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stoplightio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://plant.treeware.earth/stoplightio/prism"]}},"created_at":"2016-03-18T03:52:09.000Z","updated_at":"2025-05-11T16:20:31.000Z","dependencies_parsed_at":"2024-01-12T22:52:05.009Z","dependency_job_id":"58711065-6e68-4ed3-8fd1-c6a0bee73420","html_url":"https://github.com/stoplightio/prism","commit_stats":{"total_commits":1832,"total_committers":100,"mean_commits":18.32,"dds":0.638646288209607,"last_synced_commit":"9e04a6531b47a22ec68eead8a00c323ed013a3c9"},"previous_names":[],"tags_count":239,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoplightio%2Fprism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoplightio%2Fprism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoplightio%2Fprism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stoplightio%2Fprism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stoplightio","download_url":"https://codeload.github.com/stoplightio/prism/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672735,"owners_count":21945482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-testing","cli","hacktoberfest","http-proxy","mock-server","mocking","oas","openapi","openapi3","postman-collection","prism","swagger"],"created_at":"2024-07-31T15:01:47.243Z","updated_at":"2025-05-12T05:33:24.098Z","avatar_url":"https://github.com/stoplightio.png","language":"TypeScript","readme":"[![Prism - API Mock Servers and Contract Testing](examples/readme-header.svg)][mocking_landing_page]\n\n[![CircleCI][circle_ci_image]][circle_ci]\n[![NPM Downloads][npm_image]][npm]\n[![Stoplight Forest](https://img.shields.io/ecologi/trees/stoplightinc)][stoplight_forest]\n\n# Prism Overview\n\nPrism is a set of packages for API mocking and contract testing with **OpenAPI v2** (formerly known as Swagger) and **OpenAPI v3.x**.\n\nPrism provides:\n\n- **Mock Servers**: Life-like mock servers from any API specification document.\n- **Validation Proxy**: Contract Testing for API consumers and developers.\n- **Comprehensive API Specification Support**: OpenAPI v3.1, OpenAPI v3.0, OpenAPI v2.0 (formerly Swagger) and Postman Collections.\n\n## Ways to Use Prism\n\n### Hosted Prism\n\nStoplight provides hosted mock servers for convenience so that API consumers can experiment with an API without the need for backend code.\n\nUse one of these options for instant, hosted mock servers:\n\n- [Stoplight Platform](https://stoplight.io/?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=github_repo_prism): Collaborative API Design Platform for designing, developing and documenting APIs with hosted mocking powered by Prism.\n- [Stoplight Studio](https://stoplight.io/studio/?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=github_repo_prism): Free visual OpenAPI designer that comes integrated with mocking powered by Prism.\n\nLearn more in the [hosted Prism documentation](https://docs.stoplight.io/docs/platform/336b74db38c50-work-with-mock-servers).\n\n### Self-hosted Prism\n\nPrism is an open-source HTTP server run from the command-line. It provides mocking, request validation, and content negotiation. Use it standalone tool or in continuous integration.\n\n![Demo of Prism Mock Server being called with curl from the CLI](./examples/prism-cli.svg)\n\n## Installation and Usage\n\nThis information refers to Open Source Prism 3.x, which is the current version most likely you will use. If you're looking for the 2.x version, look at the [`2.x` branch][2.x]\n\n### Install Self-hosted Prism\n\nPrism requires\n\n- NodeJS \u003e= 18.20.1\n- for NodeJS 18.x, [\u003e= 18.16 is required](https://github.com/stoplightio/prism/issues/2305)\n\n```bash\nnpm install -g @stoplight/prism-cli\n\n# OR\n\nyarn global add @stoplight/prism-cli\n```\n\nFor more installation options, see our [installation documentation](./docs/getting-started/01-installation.md).\n\n### Mocking\n\nPrism can help you create a fake \"mock\" based off an OpenAPI document, which helps people see how your API will work before you even have it built. Run it locally with the `prism mock` command to run your API on a HTTP server you can interact with.\n\n```bash\nprism mock https://raw.githack.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore-expanded.yaml\n```\n\nLearn more about [how the mock server works](docs/guides/01-mocking.md).\n\n### Validation Proxy\n\nPrism can help you check for discrepencies between your API implementation and the OpenAPI document that describes, letting you funnel HTTP traffic through it with the `prism proxy` command.\n\n```bash\nprism proxy examples/petstore.oas2.yaml https://petstore.swagger.io/v2\n```\n\nLearn more about [how the validation proxy works](docs/guides/03-validation-proxy.md).\n\n## 📖 Documentation and Community\n\n- [Documentation](https://docs.stoplight.io/docs/prism/674b27b261c3c-prism-overview)\n  - [Getting Started](./docs/getting-started/01-installation.md)\n  - [Guides](./docs/guides/01-mocking.md)\n- [Community](https://github.com/stoplightio/prism/discussions)\n\n### ❓ FAQs\n\n**Cannot access mock server when using Docker?**\n\nPrism uses localhost by default, which usually means 127.0.0.1. When using docker the mock server will\nbe unreachable outside of the container unless you run the mock command with `-h 0.0.0.0`.\n\n**Why am I getting 404 errors when I include my basePath?**\n\nOpenAPI v2.0 had a concept called \"basePath\", which was essentially part of the HTTP path the stuff\nafter host name and protocol, and before query string. Unlike the paths in your `paths` object, this\nbasePath was applied to every single URL, so Prism v2.x used to do the same. In OpenAPI v3.0 they\nmerged the basePath concept in with the server.url, and Prism v3 has done the same.\n\nWe treat OAS2 `host + basePath` the same as OAS3 `server.url`, so we do not require them to go in\nthe URL. If you have a base path of `api/v1` and your path is defined as `hello`, then a request to\n`http://localhost:4010/hello` would work, but `http://localhost:4010/api/v1/hello` will fail. This\nconfuses some, but the other way was confusing to others. Check the default output of Prism CLI to\nsee what URLs you have available.\n\n### 🚧 Roadmap\n\n- [x] Content Negotiation\n- [x] Security Validation\n- [x] Validation Proxy\n- [ ] [Recording/Learning Mode](https://roadmap.stoplight.io/c/324-learning-recording?utm_source=github\u0026utm_medium=prism\u0026utm_campaign=readme) (create OpenAPI from HTTP traffic)\n- [ ] [Data Persistence](https://roadmap.stoplight.io/c/308-persisted-mock-data?utm_source=github\u0026utm_medium=prism\u0026utm_campaign=readme) (allow Prism act like a sandbox)\n\nSubmit your ideas for new functionality on the [Stoplight Roadmap](https://roadmap.stoplight.io/?utm_source=github\u0026utm_medium=prism\u0026utm_campaign=readme).\n\n### 🏁 Help Others Utilize Prism\n\nIf you're using Prism for an interesting use case, [contact us](mailto:growth@stoplight.io) for a case study. We'll add it to a list here. Spread the goodness 🎉\n\n### 👏 Contributing\n\nIf you are interested in contributing to Prism itself, check out our [contributing docs ⇗][contributing] and [code of conduct ⇗][code_of_conduct] to get started.\n\n### 🎉 Thanks\n\nPrism is built on top of lots of excellent packages, and here are a few we'd like to say a special thanks to.\n\n- [ajv](https://www.npmjs.com/package/ajv)\n- [faker](https://www.npmjs.com/package/@faker-js/faker)\n- [fp-ts](https://www.npmjs.com/package/fp-ts)\n- [gavel](https://www.npmjs.com/package/gavel)\n- [json-schema-faker](https://www.npmjs.com/package/json-schema-faker)\n- [lerna](https://www.npmjs.com/package/lerna)\n- [micri](https://www.npmjs.com/package/micri)\n- [openapi-sampler](https://www.npmjs.com/package/openapi-sampler)\n- [yargs](https://www.npmjs.com/package/yargs)\n\nCheck these projects out!\n\n### 🌲 Sponsor Prism by Planting a Tree\n\nIf you would like to thank us for creating Prism, we ask that you [**buy the world a tree**](https://ecologi.com/stoplightinc).\n\n[code_of_conduct]: CODE_OF_CONDUCT.md\n[contributing]: CONTRIBUTING.md\n[download-release]: https://github.com/stoplightio/prism/releases/latest\n[core]: https://www.npmjs.com/package/@stoplight/prism-core\n[http]: https://www.npmjs.com/package/@stoplight/prism-http\n[http-server]: https://www.npmjs.com/package/@stoplight/prism-http-server\n[cli]: https://www.npmjs.com/package/@stoplight/prism-cli\n[cli-docs]: ./docs/getting-started/03-cli.md\n[2.x]: https://github.com/stoplightio/prism/tree/2.x\n[http-docs]: packages/http/README.md\n[mocking_landing_page]: https://stoplight.io/api-mocking?utm_source=github.com\u0026utm_medium=referral\u0026utm_campaign=github_repo_prism\n[circle_ci]: https://circleci.com/gh/stoplightio/prism\n[circle_ci_image]: https://img.shields.io/circleci/build/github/stoplightio/prism/master\n[npm]: https://www.npmjs.com/package/@stoplight/prism-cli\n[npm_image]: https://img.shields.io/npm/dw/@stoplight/prism-http?color=blue\n[stoplight_forest]: https://ecologi.com/stoplightinc\n","funding_links":["https://plant.treeware.earth/stoplightio/prism"],"categories":["TypeScript","Projects using `@faker-js/faker`","HarmonyOS","Packages","Recently Updated","API Design Tools","Web Testing","cli","API Debugging and Mocking","Projects"],"sub_categories":["Windows Manager","[Apr 09, 2025](/content/2025/04/09/README.md)","Hosted","API Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoplightio%2Fprism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoplightio%2Fprism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoplightio%2Fprism/lists"}