{"_id":"@atlassian/oas3-chow-chow","name":"@atlassian/oas3-chow-chow","dist-tags":{"latest":"5.0.0"},"versions":{"5.0.0":{"name":"@atlassian/oas3-chow-chow","version":"5.0.0","main":"lib/index.js","types":"lib/index.d.ts","author":{"email":"tli@atlassian.com"},"license":"Apache-2.0","publishConfig":{"registry":"https://packages.atlassian.com/api/npm/npm-public/"},"repository":{"type":"git","url":"git+https://github.com/atlassian/oas3-chow-chow.git"},"scripts":{"build":"tsc","test":"jest --coverage --no-watchman","test:watch":"jest --watch","test:watch:debug":"node --inspect node_modules/.bin/jest --runInBand --watch","lint":"yarn lint:prettier","lint:prettier":"prettier src \"__test__/**/*.ts\" --check","fix:prettier":"yarn lint:prettier --write","prepublishOnly":"rm -rf lib && yarn build","release":"yarn prepublishOnly && changeset publish"},"prettier":{"singleQuote":true},"dependencies":{"@apidevtools/json-schema-ref-parser":"^11.1.0","ajv":"^8.12.0","ajv-formats":"^2.1.1","better-ajv-errors":"1.2.0","oas-validator":"^5.0.8","openapi3-ts":"^1.3.0","xregexp":"^4.2.4"},"devDependencies":{"@changesets/cli":"2.26.2","@types/jest":"29.5.4","@types/node":"18.19.64","@types/xregexp":"3.0.30","babel-core":"6.26.3","babel-jest":"^29.7.0","jest":"^29.7.0","prettier":"2.2.1","ts-jest":"^29.1.1","typescript":"5.6.3"},"_id":"@atlassian/oas3-chow-chow@5.0.0","description":"> Request and response validator against OpenAPI Specification","bugs":{"url":"https://github.com/atlassian/oas3-chow-chow/issues"},"homepage":"https://github.com/atlassian/oas3-chow-chow#readme","_integrity":"sha512-wHLRsZlGuL6aaWi3tdZcMb0r7jiEjk3RBuWIFImGqjiUcHdVupI3Utqx8Fyj/EiT1d4COM+1NSkXUK5172I3yw==","_resolved":"/tmp/package-1-68d0a65c-cf576d4a52d0c7823c1f7eee-1.tgz","_from":"file:/tmp/package-1-68d0a65c-cf576d4a52d0c7823c1f7eee-1.tgz","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-wHLRsZlGuL6aaWi3tdZcMb0r7jiEjk3RBuWIFImGqjiUcHdVupI3Utqx8Fyj/EiT1d4COM+1NSkXUK5172I3yw==","shasum":"1af0a9c270618ac3e1a0864f1d172310d2294e93","tarball":"https://registry.npmjs.org/@atlassian/oas3-chow-chow/-/oas3-chow-chow-5.0.0.tgz","fileCount":76,"unpackedSize":105597,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDI7suP2x+eqedTHuQupP+dr26Vg7ueiWukx3wvUG28KAiEAopTzpLh97uVoDFiBGkxyPJyIcrop+h+qyvfvi6mCILI="}]},"_npmUser":{"name":"atlassianartifactteam","email":"eng-development-tooling-secrets-and-artifacts@atlassian.com"},"directories":{},"maintainers":[{"name":"atlassianartifactteam","email":"eng-development-tooling-secrets-and-artifacts@atlassian.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/oas3-chow-chow_5.0.0_1758504543812_0.7485679898824213"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-22T01:29:03.751Z","5.0.0":"2025-09-22T01:29:03.995Z","modified":"2025-09-22T01:29:04.249Z"},"maintainers":[{"name":"atlassianartifactteam","email":"eng-development-tooling-secrets-and-artifacts@atlassian.com"}],"description":"> Request and response validator against OpenAPI Specification","homepage":"https://github.com/atlassian/oas3-chow-chow#readme","repository":{"type":"git","url":"git+https://github.com/atlassian/oas3-chow-chow.git"},"author":{"email":"tli@atlassian.com"},"bugs":{"url":"https://github.com/atlassian/oas3-chow-chow/issues"},"license":"Apache-2.0","readme":"# oas3-chow-chow\n\n> Request and response validator against OpenAPI Specification\n\n[![Build Status](https://travis-ci.org/atlassian/oas3-chow-chow.svg?branch=master)](https://travis-ci.org/atlassian/oas3-chow-chow)\n[![npm](https://img.shields.io/npm/v/oas3-chow-chow.svg?style=flat)](https://www.npmjs.com/package/oas3-chow-chow)\n\n## Notes\n\nIf you are looking for framework specific middleware, you might want to look at following libraries that use oas3-chow-chow under the hood.\n\n[koa-oas3](https://github.com/atlassian/koa-oas3)\n[openapi3-middleware](https://github.com/naugtur/openapi3-middleware)\n\n## Installation\nNote: Starting from version 5, it's transferred to be under `@atlassian` scope.\n\n```bash\n$ yarn add @atlassian/oas3-chow-chow\n$ # Or\n$ npm i @atlassian/oas3-chow-chow\n```\n\n## Usage\n\n```typescript\nimport ChowChow from \"@atlassian/oas3-chow-chow\";\nimport * as fs from \"fs\";\nimport * as yaml from \"js-yaml\";\n\nvar doc = yaml.safeLoad(fs.readFileSync(\"./openapi.yml\", \"utf8\"));\nconst chow = ChowChow.create(doc);\n\n// For URL: /:pathParam/info?arrParam=x&arrParam=y&other=z\nchow.validateRequestByPath(\n  // url.pathname,\n  \"/books/info\",\n  \"POST\", {\n    path: { pathParam: \"books\" },\n    // query: querystring.parse(url.search.substr(1)),\n    query: { arrParam: [\"x\", \"y\"], other: \"z\" },\n    // header: req.headers,\n    header: { \"Content-Type\": \"application/json\" },\n    body: { a: 1, b: 2 },\n  }\n);\nchow.validateResponseByPath(\"/books/info\", \"POST\", {\n  header: { \"Content-Type\": \"application/json\" },\n  body: {\n    name: \"a nice book\",\n    author: \"me me me\"\n  }\n});\n```\n\n## Config\n\nYou could optionally provide configs to the constructor\n```typescript\nconst chow = ChowChow.create(doc, {\n  headerAjvOptions: {},\n  cookieAjvOptions: {},\n  pathAjvOptions: { coerceTypes: true },\n  queryAjvOptions: { coerceTypes: 'array' },\n  requestBodyAjvOptions: {},\n  responseBodyAjvOptions: {},\n});\n```\n\n* **headerAjvOptions**: Ajv options that pass to header ajv instance\n* **cookieAjvOptions**: Ajv options that pass to cookie ajv instance\n* **pathAjvOptions**: Ajv options that pass to path ajv instance, default `{ coerceTypes: true }`\n* **queryAjvOptions**: Ajv options that pass to query ajv instance, default `{ coerceTypes: 'array' }`\n* **requestBodyAjvOptions**: Ajv options that pass to request body ajv instance\n* **responseBodyAjvOptions**: Ajv options that pass to response body ajv instance\n\n## Contributors\n\nPull requests, issues and comments welcome. For pull requests:\n\n* Add tests for new features and bug fixes\n* Follow the existing style\n* Separate unrelated changes into multiple pull requests\n* See the existing issues for things to start contributing.\n\nFor bigger changes, make sure you start a discussion first by creating an issue and explaining the intended change.\n\nAtlassian requires contributors to sign a Contributor License Agreement, known as a CLA. This serves as a record stating that the contributor is entitled to contribute the code/documentation/translation to the project and is willing to have it used in distributions and derivative works (or is willing to transfer ownership).\n\nPrior to accepting your contributions we ask that you please follow the appropriate link below to digitally sign the CLA. The Corporate CLA is for those who are contributing as a member of an organization and the individual CLA is for those contributing as an individual.\n\n* [CLA for corporate contributors](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=e1c17c66-ca4d-4aab-a953-2c231af4a20b)\n* [CLA for individuals](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=3f94fbdc-2fbe-46ac-b14c-5d152700ae5d)\n","readmeFilename":"README.md","_rev":"1-0d30de6ad1f4dbca2502add61bba19b1"}