{"_id":"@apiture/api-ref-resolver","_rev":"3-89793a09cdcb4b2edc66252b8414354f","name":"@apiture/api-ref-resolver","dist-tags":{"latest":"1.3.2"},"versions":{"1.0.5":{"name":"@apiture/api-ref-resolver","version":"1.0.5","description":"Tool to merge multiple OpenAPI or AsyncAPI documents that use JSON Reference links (`$ref`) to reference API definition elements across source files.","main":"lib/src/index.js","bin":{"arr":"lib/src/cli.js","api-ref-resolver":"lib/src/cli.js"},"scripts":{"prepare":"npx tsc","compile":"npx tsc","test":"npx jest --collect-coverage test","coverage":"true","lint":"npx eslint --fix --ext .ts src test ","pipeline-lint":"npx eslint --ext .ts src test","clean":"rm -rf lib"},"repository":{"type":"git","url":"git+ssh://git@bitbucket.org/APITURE/api-ref-resolver.git"},"keywords":["JSON","$ref","resolve","OpenAPI","AsyncAPI"],"pre-push":["lint","test"],"author":{"name":"David Biesack","email":"David.Biesack@apiture.com"},"license":"ISC","homepage":"https://bitbucket.org/APITURE/api-ref-resolver#readme","dependencies":{"bl":"^5.0.0","commander":"^9.0.0","fs-extra":"^10.0.0","js-yaml":"^4.1.0","json-pointer":"^0.6.1","mkdirs":"0.0.3","typescript":"^4.5.5"},"devDependencies":{"@types/commander":"^2.12.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","jest":"^27.5.1","pre-push":"^0.1.1","@jest/globals":"^27.5.1","ts-jest":"^27.1.3","eslint":"^8.9.0","eslint-plugin-import":"^2.25.4","eslint-plugin-jsx-a11y":"^6.5.1","eslint-plugin-prettier":"^4.0.0","eslint-plugin-react":"^7.28.0","prettier":"^2.5.1"},"types":"./lib/src/index.d.ts","gitHead":"41438e0d05354110315867e077b52b7701bc1faa","bugs":{"url":"https://bitbucket.org/APITURE/api-ref-resolver/issues"},"_id":"@apiture/api-ref-resolver@1.0.5","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-7W27tkotvrMK/uEBpnSrzPpmhTNCQadhZa5zl+J56MteF9lOhbqaE7ZSPQKVqj4FthNcQC5BQCNBBVegy16w3g==","shasum":"107e9c8aa5807401121258e860eb6819ca9b0e2d","tarball":"https://registry.npmjs.org/@apiture/api-ref-resolver/-/api-ref-resolver-1.0.5.tgz","fileCount":24,"unpackedSize":97970,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj477CGFcipaqrALksDkVsoa2Z0fYEdi4Bm58tp2mxqAIhANVMVezfItWM01woZ9w+sLmSnaR8WERlBDK8mUo7XVO+"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVcykACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgZQ/+ILsduQI4tQZfzZpLM+7OPzFlklRb46MiPEcFA7L6BWrmn3ig\r\nt86l9xnSR1FLFRVKJrgCQUymg9uDVbMcW/Nzu290fGxMKI+B8l/lDZfB3MzL\r\nnv7PoftGPT8dFEh6Si4YjdeC1zxd4Gc4BY6vBLe57bKNzY66Q6wlKmllujU2\r\nQHvzwryywFjqpwLm/2JBOBEBGLkD4GBYSbNKb+tXRjs8PtLKKAf5wypHWnu1\r\n1vko+W/Pkaw5Nqwzqaj4K6LnEEXqIrlJPEB0RQWiL57i0MyBYps2Q5iOrGXy\r\n9hZP+ZHkOHfv8v+I18c43tFgTNhpp1evSodJ+OYm3lFp9HKecjUnRtRd+1d/\r\ngaqqI3jvUaQLbF0JmtrmjG885OF3NzMHYukPMKzVZ0baRCZMPcjid5tttPfJ\r\nqeSnawDtfIW9SB6V7eHJqqusE429R5pdZkbuLljJT8KkivO+YD/Cb2bPerjM\r\nNlTVh3GA3v0w2sbt1ONsxkr7sIESPq//RyjRobNElE9rWFQxS/72fqFCfiQD\r\nre2mQmUjdhNCtWmzg1jQPaJo6ZAi1LLSkupLR9+icKQg0pFfYFGlUEQMSxxe\r\nNc/S/3m6x701UfMF0DXCIOwN6LhPEwXP8eyWyzkndbQZk2ZHgRjI4FtTIePK\r\nogsOuWKOixIGwySIY4Nk6lYWFvRVUQCLxTY=\r\n=wUGL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"apiture.dev","email":"oss@apiture.com"},"directories":{},"maintainers":[{"name":"apiture.dev","email":"oss@apiture.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-ref-resolver_1.0.5_1649790116502_0.95494330411054"},"_hasShrinkwrap":false},"1.2.0":{"name":"@apiture/api-ref-resolver","version":"1.2.0","description":"Tool to merge multiple OpenAPI or AsyncAPI documents that use JSON Reference links (`$ref`) to reference API definition elements across source files.","main":"lib/src/index.js","bin":{"arr":"lib/src/cli.js","api-ref-resolver":"lib/src/cli.js"},"scripts":{"prepare":"npx tsc","compile":"npx tsc","test":"npx jest --collect-coverage test","coverage":"true","lint":"npx eslint --fix --ext .ts src test ","pipeline-lint":"npx eslint --ext .ts src test","clean":"rm -rf lib"},"repository":{"type":"git","url":"git+ssh://git@github.com/apiture/api-ref-resolver.git"},"keywords":["JSON","$ref","resolve","OpenAPI","AsyncAPI"],"pre-push":["lint","test"],"author":{"name":"David Biesack","email":"David.Biesack@apiture.com"},"license":"ISC","homepage":"https://bitbucket.org/APITURE/api-ref-resolver#readme","dependencies":{"bl":"^5.0.0","commander":"^9.0.0","fs-extra":"^10.0.0","js-yaml":"^4.1.0","json-pointer":"^0.6.1","mkdirs":"0.0.3","typescript":"^4.5.5"},"devDependencies":{"@types/commander":"^2.12.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","jest":"^27.5.1","pre-push":"^0.1.1","@jest/globals":"^27.5.1","ts-jest":"^27.1.3","eslint":"^8.9.0","eslint-plugin-import":"^2.25.4","eslint-plugin-jsx-a11y":"^6.5.1","eslint-plugin-prettier":"^4.0.0","eslint-plugin-react":"^7.28.0","prettier":"^2.5.1"},"types":"./lib/src/index.d.ts","gitHead":"ee14565521dab0239fbb204d88e066be2dde4a53","bugs":{"url":"https://github.com/apiture/api-ref-resolver/issues"},"_id":"@apiture/api-ref-resolver@1.2.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-JB1aQRmoKNBE8Lh4KdIphuXcc1Bn+YrLT8mdRLdu0SC6G1F9qYlYyOQGIzGOMMaRkel7HsmFnkWoJEwDt1wmDg==","shasum":"31a2e5f47fa39a586475f6329b73f9e14f4494ad","tarball":"https://registry.npmjs.org/@apiture/api-ref-resolver/-/api-ref-resolver-1.2.0.tgz","fileCount":24,"unpackedSize":108236,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUZsSE8GxvZ238x+UsbnhFmw8aeW780FkYg5DpSUXtuQIhALtqWeFiNNPj3EjIGBJuIZVw+4mXD9VFfyt++4VApZv4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilk4fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmzA/+M3BUOeY+QJ0UPB18MdzoP+XuHBTB7Msp5uq+6XIhvphXijNS\r\nsXvQfENAuQzLG+vzMRw3y72/TEg+oC7CqIHzlbJ0LLuFRLTJkwLGzmXkOPLL\r\nn5R97wQQ+MWj9vDhgW/rPyV4tbMK1Qwcv+ecugCSSbwyxn28+4P1oAGVhlBW\r\nbO3E6OkXevEf3GUFTtBgjzHxjEqGr9+aWW5AEJVyMlR3X7PiJFZGuCFn71dD\r\nS9CSd7I7LR3e+hHzHgyc+LsU7TYmEYloGhov1nLNG54psGerb6RprR1qN0Pl\r\nFlW3IqcO35Fww+fpdoGgne3D3huzs0xixnC+pZtdSPHJb6p5eSTTsOTvgEmZ\r\ndAUQ8YCDKFyOPfsrpIJhwKpMxmpTnhOR6Nly/NdutNjQTMI0GV01M7whZ/ya\r\n/M2VTrYqxz6kJSDAXZV3felrdQjnyPZZnYtrvtdbYlZfv0apLkvq2FidfsB6\r\nRefyKcBU+nep8ddXQCuKmJBVUS04f2IJoq/dyykNg2i93gDMpPPo2HFie5yL\r\nKbO+ifuEQ1HPDKibrWKokYOLJlNhHeCSBIX63bNxFtYRKXpQvc2Rpui+wCV3\r\nFboVtle+An5prxfznrp4GPeIEVqS7Mnl0JlEib1oqZxt6b356Dmo4qEPICpf\r\nrY14XEM/FhjG3Lk/9RgqnWNcWZSvK2j6Fl0=\r\n=ZTKd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"apiture.dev","email":"oss@apiture.com"},"directories":{},"maintainers":[{"name":"apiture.dev","email":"oss@apiture.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-ref-resolver_1.2.0_1654017566767_0.5171507028384092"},"_hasShrinkwrap":false},"1.3.1":{"name":"@apiture/api-ref-resolver","version":"1.3.1","description":"Tool to merge multiple OpenAPI or AsyncAPI documents that use JSON Reference links (`$ref`) to reference API definition elements across source files.","main":"lib/src/index.js","bin":{"arr":"lib/src/cli.js","api-ref-resolver":"lib/src/cli.js"},"scripts":{"prepare":"npx tsc","compile":"npx tsc","test":"npx jest --collect-coverage test","coverage":"true","lint":"npx eslint --fix --ext .ts src test ","pipeline-lint":"npx eslint --ext .ts src test","clean":"rm -rf lib"},"repository":{"type":"git","url":"git+ssh://git@github.com/apiture/api-ref-resolver.git"},"keywords":["JSON","$ref","resolve","OpenAPI","AsyncAPI"],"pre-push":["lint","test"],"author":{"name":"David Biesack","email":"David.Biesack@apiture.com"},"license":"ISC","homepage":"https://github.com/apiture/api-ref-resolver/blob/main/README.md","dependencies":{"bl":"^5.0.0","commander":"^9.0.0","fs-extra":"^10.0.0","js-yaml":"^4.1.0","json-pointer":"^0.6.1","mkdirs":"0.0.3"},"devDependencies":{"@types/commander":"^2.12.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","jest":"^27.5.1","pre-push":"^0.1.1","@jest/globals":"^27.5.1","ts-jest":"^27.1.3","typescript":"^4.5.5","eslint":"^8.9.0","eslint-plugin-import":"^2.25.4","eslint-plugin-jsx-a11y":"^6.5.1","eslint-plugin-prettier":"^4.0.0","eslint-plugin-react":"^7.28.0","prettier":"^2.5.1"},"types":"./lib/src/index.d.ts","gitHead":"7015d705d9178149245b1014fd6a5e8c163a8e2a","bugs":{"url":"https://github.com/apiture/api-ref-resolver/issues"},"_id":"@apiture/api-ref-resolver@1.3.1","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-v4v9ZB8m9XaoTyi7mDgCaPFzrBMBEIequduwjcfWRn6iGSmqmcO9EUPOn4eYeFDjwvlWa3mDkCvbOSogzW0MbA==","shasum":"f6694ed02a69fbcb36b785d11266d3b4240ed7a9","tarball":"https://registry.npmjs.org/@apiture/api-ref-resolver/-/api-ref-resolver-1.3.1.tgz","fileCount":24,"unpackedSize":108419,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDr+rTGgzfjmj9iW2x0URp3ddF78jJUBlU4Z+yp+4OtzwIhANEv7iX91cxP5L84j3AduHHBoC/mQ04Q9IVJVJ1ETeym"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi48r+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYag//UQ+9gB7LQ1BLBQHcTwTGn4V3Zd5N0ugU/xLFkxLQDrZ0VcOn\r\n7MvZbsCi5TIulf7ggoBr3jpfXadOu+OojHxFmLKvo2Y5mVM+JBwyTVTDkrI/\r\nzOCfZWncVzJDvLrp8Ui7+IaKdrNzBcwQLi3NnHpRHIv1nIpUcO3AqUpohi8b\r\nrsUYm3sgv+O7SuVEQ6NFZR2gXYex10RbHWqtYyQQrBfXqVbxHkHWOmEeNtQW\r\niQ9YFbmiUHIzZUCjhyQsaTX2ju+mwVkAgsQXASl2QYeVov5oldAtxI79nRbi\r\nWVQ9Br/Yn9zHiR8z+qxjwYWR0aX1I3kdFGVfmUvV9UPPaY5Mnwbpz7Akr0TD\r\n/HN9GSALJPtk5cWZfl4KXqle7vYyASKoFxbf5kRMxkt0nkLdM7xNQ/p1udIF\r\nQJ6HoP0k1Vr0kLiuEQTo3Fit9mmuV8MfbDy0N2xrOIUxVFhSCKlsq+DyFz0P\r\neGd8Yv0HPfdY6ArICA9IFwYZERaPa2kOIkclQwu94e3sOXylYPZsRVciPaXG\r\n9uZhl1EnzsW2/+3LW89/VbsioIIRafUu4eU8PXpgZwFnxmX01PXRS5RQ8aVM\r\n1NgukkQXfuMVG64VdVfi2Cs4po5kFi2DPlCbeP0sr/aPRboY8rD0detJqWY2\r\nffSEG77kAkgfKEpVG5RsBkZjKiwEvlV7+3Y=\r\n=RmOZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"apiture.dev","email":"oss@apiture.com"},"directories":{},"maintainers":[{"name":"apiture.dev","email":"oss@apiture.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-ref-resolver_1.3.1_1659095806142_0.7217810448727662"},"_hasShrinkwrap":false},"1.3.2":{"name":"@apiture/api-ref-resolver","version":"1.3.2","description":"Tool to merge multiple OpenAPI or AsyncAPI documents that use JSON Reference links (`$ref`) to reference API definition elements across source files.","main":"lib/src/index.js","bin":{"arr":"lib/src/cli.js","api-ref-resolver":"lib/src/cli.js"},"scripts":{"prepare":"npx tsc","compile":"npx tsc","test":"npx jest --collect-coverage test","coverage":"true","lint":"npx eslint --fix --ext .ts src test ","pipeline-lint":"npx eslint --ext .ts src test","clean":"rm -rf lib"},"repository":{"type":"git","url":"git+ssh://git@github.com/apiture/api-ref-resolver.git"},"keywords":["JSON","$ref","resolve","OpenAPI","AsyncAPI"],"pre-push":["lint","test"],"author":{"name":"David Biesack","url":"https://github.com/DavidBiesack"},"license":"ISC","homepage":"https://github.com/apiture/api-ref-resolver/blob/main/README.md","dependencies":{"bl":"^5.0.0","commander":"^9.0.0","fs-extra":"^10.0.0","js-yaml":"^4.1.0","json-pointer":"^0.6.1","mkdirs":"0.0.3"},"devDependencies":{"@types/commander":"^2.12.2","@typescript-eslint/eslint-plugin":"^5.12.0","@typescript-eslint/parser":"^5.12.0","jest":"^27.5.1","pre-push":"^0.1.1","@jest/globals":"^27.5.1","ts-jest":"^27.1.3","typescript":"^4.5.5","eslint":"^8.9.0","eslint-plugin-import":"^2.25.4","eslint-plugin-jsx-a11y":"^6.5.1","eslint-plugin-prettier":"^4.0.0","eslint-plugin-react":"^7.28.0","prettier":"^2.5.1"},"types":"./lib/src/index.d.ts","gitHead":"e38a7b87143c7af79fabb46e374555eee3539c8f","bugs":{"url":"https://github.com/apiture/api-ref-resolver/issues"},"_id":"@apiture/api-ref-resolver@1.3.2","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-OzOCg7wnV/L2FSVxDREPdELQv8kLBulRgldfqjwHNmnqBbIRqGth9PdREiTR5KGpBNA5XcvB1mumI+gxPrgGvg==","shasum":"ee88be7e5bcf03f404e4295fe4f0bdb89e0e8206","tarball":"https://registry.npmjs.org/@apiture/api-ref-resolver/-/api-ref-resolver-1.3.2.tgz","fileCount":24,"unpackedSize":108470,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOYThQHjFaN7l+7X9m8kr6SWC2rM4AhlvXnqQuW3bkjQIhAOji+UPfHR/UhOUBwM6ZQLRzenrIXyxb842O/exeE1Bz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSIGrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoXUA//ZbVFnXENPeh4F/lm7mOAcJjlyflxfA0WTSgd89hK4YySBpFq\r\nIjqdfqUrcFh+AgYyeUBd0BWISRPT52V3VxzL95J/yY57lWj8igll1HCduJ8g\r\nUmVSZ8JHTjfa42+pxTvlfvHSatdlgDoUUOsuPSBDREEh3bsWeCD5YWbVjIyv\r\nQAFUvZeqAUGMkmUFdQtfo5b0YiRyFHETrzm26GW4sbQg7wu+rL9KrhPUEVRi\r\nu6p8Nx8w1ObC3PkrdlQ3b5NAuwzmrVsPgY1XDa3ndimxBcGzCStYz+eGonUP\r\nzQJD1aazd6OcRKsGMZWa2frizJO6taHRRur5CTwnUxYy6wXG4DRoi/7w4cGt\r\nS72wMUtVmhpmym6BwxiHNcyqG4QemZBPkAGlD/whUAlktt2sUWsb5yM/LroK\r\n+DX/JH5+rvjEH4dY1qFs4xJm+z+o4jLL8t87su8SpWtjM+izbY3E9+qu+F0a\r\nRyLxJ21C8Ynia48jh2hYIUoDjXmtPVaE3lBhWIGA2o6Kepea1xa0HHx/SQpS\r\nnHYOkLeQQ7VWXszcL8gNUrvLIwZYnUN4K8iKh3V6/1tepPDeWw06eOiZthmX\r\nBI3ruhJfIgl/AzInZKGZd22NWHmg9OXHv3GRvFHOIkOVESQfd7CJC+cppPyo\r\nPC7H9K3/v2ye5z28fzUgF6c+zXuKCNm5tkM=\r\n=JAM2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"apiture.dev","email":"oss@apiture.com"},"directories":{},"maintainers":[{"name":"apiture.dev","email":"oss@apiture.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/api-ref-resolver_1.3.2_1665696171108_0.5337679791979133"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-12T19:01:56.456Z","1.0.5":"2022-04-12T19:01:56.766Z","modified":"2022-10-13T21:22:51.442Z","1.2.0":"2022-05-31T17:19:26.982Z","1.3.1":"2022-07-29T11:56:46.332Z","1.3.2":"2022-10-13T21:22:51.331Z"},"maintainers":[{"name":"apiture.dev","email":"oss@apiture.com"}],"description":"Tool to merge multiple OpenAPI or AsyncAPI documents that use JSON Reference links (`$ref`) to reference API definition elements across source files.","homepage":"https://github.com/apiture/api-ref-resolver/blob/main/README.md","keywords":["JSON","$ref","resolve","OpenAPI","AsyncAPI"],"repository":{"type":"git","url":"git+ssh://git@github.com/apiture/api-ref-resolver.git"},"author":{"name":"David Biesack","url":"https://github.com/DavidBiesack"},"bugs":{"url":"https://github.com/apiture/api-ref-resolver/issues"},"license":"ISC","readme":"# @apiture/api-ref-resolver\n\n`api-ref-resolver` resolves multi-file API definition documents by replacing\nexternal `{$ref: \"uri\"}` [JSON Reference](https://datatracker.ietf.org/doc/html/draft-pbryan-zyp-json-ref-03)\nobjects with the object referenced at the `uri`.\nThe `uri` may be a file-path or a URL with an optional\n`#` [JSON Pointer fragment](https://datatracker.ietf.org/doc/html/draft-ietf-appsawg-json-pointer-04).\n\nFor example, if `components.yaml` contains: <!-- content from: test/data/readme-example/component.yaml -->\n\n```yaml\npaths:\n  '/health':\n    get:\n      operationId: apiHealth\n      description: Return API Health\n      tags:\n        - Health\n      responses:\n        '200':\n          description: OK. The API is alive and active.\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/health'\ncomponents:\n  parameters:\n    idempotencyKeyHeaderParam:\n      name: Idempotency-Key\n      description: Idempotency Key to guarantee client requests and not processed multiple times.\n      in: header\n      schema:\n        type: string\n  schemas:\n    health:\n      title: API Health\n      description: API Health response\n      type: object\n      properties:\n        status:\n          description: The API status.\n          type: string\n          enum:\n            - pass\n            - fail\n            - warn\n```\n\nand `api.yaml` contains <!-- content from: test/data/readme-example/api.yaml -->\n\n```yaml\npaths:\n  /health:\n    get:\n      $ref: 'components.yaml#/paths/~1health/get'\n  /thing:\n    parameters:\n      - $ref: 'components.yaml#/components/parameters/idempotencyKeyHeaderParam'\n```\n\nthen running\n\n```bash\napi-ref-resolver -i api.yaml -o resolved-api.yaml\n```\n\nwill yield the following in `resolved-api.yaml`:\n\n<!-- generate resolved-api.yaml with test/data/readme-example/generate-example.sh\n     content from: test/data/readme-example/resolved-api.yaml -->\n```yaml\npaths:\n  /health:\n    get:\n      operationId: apiHealth\n      description: Return API Health\n      tags:\n        - Health\n      responses:\n        '200':\n          description: OK. The API is alive and active.\n          content:\n            application/json:\n              schema:\n                $ref: '#/components/schemas/health'\n      x-resolved-from: >-\n        components.yaml#/paths/~1health/get\n  /thing:\n    parameters:\n      - $ref: '#/components/parameters/idempotencyKeyHeaderParam'\ncomponents:\n  parameters:\n    idempotencyKeyHeaderParam:\n      name: Idempotency-Key\n      description: >-\n        Idempotency Key to guarantee client requests and not processed multiple\n        times.\n      in: header\n      schema:\n        type: string\n      x-resolved-from: >-\n        components.yaml#/components/parameters/idempotencyKeyHeaderParam\n  schemas:\n    health:\n      title: API Health\n      description: API Health response\n      type: object\n      properties:\n        status:\n          description: The API status.\n          type: string\n          enum:\n            - pass\n            - fail\n            - warn\n      x-resolved-from: >-\n        components.yaml#/components/schemas/health\nx-resolved-from: >-\n  api.yaml\nx-resolved-at: '2022-03-11T16:27:59.365Z'\n\n```\n\nThe tool handles chains of JSON references (i.e. `a.yaml` references components from `b.yaml` which references components from `c.yaml`) as\nwell as direct or indirect cycles (component `A` references component `B` which references component `A`).\n\nUnlike other generic `$ref` resolvers ([1](https://github.com/Mermade/oas-kit/tree/main/packages/oas-resolver), [2](https://www.npmjs.com/package/@stoplight/json-ref-resolver), [3](https://github.com/APIDevTools/json-schema-ref-parser)),\n`api-ref-resolver` treats `components` references specially.\nIt understands reusable `components/section/componentName` objects at the top-level of an API definition, such as `#/components/schemas/schemaName`, and attempts to\nmaintain those component structures; see [Notes](#notes) below.\nOtherwise, it is specification agnostic and works with either\n[OpenAPI](https://www.openapis.org/) specification or [AsyncAPI](https://www.asyncapi.com/) specification.\n\nThis tool does _not_ enforce JSON Reference strictness; that is, the `$ref` member may have siblings, as used in [OpenAPI 3.1 Reference Objects](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject).\n\n## Use\n\n### Command Line Interface\n\n```bash\napi-ref-resolver --input api.yaml --output resolved-api.yaml\n# arr is also defined a shortcut command for api-ref-resolver\narr --input api.yaml --output resolved-api.yaml\narr -i  api.yaml | some-other-pipeline >| resolved-api.yaml\n```\n\nCommand line options:\n\n<!-- run `api-ref-resolver --help` to generate this help -->\n```text\nUsage: api-ref-resolver [options]\n\nOptions:\n  -V, --version               output the version number\n  -i, --input <input-file>    An openapi.yaml or asyncapi.yaml file name or URL. Defaults to \"api.yaml\"\n  -n, --no-markers            Do not add x-resolved-from and x-resolved-at markers\n  -o, --output <output-file>  The output file, defaults to stdout if omitted\n  -f, --format [yaml|json]    Output format for stdout if no --output option is used; default to yaml\n  -v, --verbose               Verbose output\n  -h, --help                  display help for command\n```\n\n### Node.js\n\n```javascript\nimport { ApiRefResolver } from '@apiture/api-ref-resolver';\nimport * as fs from 'fs';\nimport * as yaml from 'js-yaml';\n\nconst sourceFileName = 'api.yaml'\nconst outputFileName = 'resolved-api.yaml'\n\nconst resolver = new ApiRefResolver(sourceFileName);\nconst options: ApiRefOptions = {\n  verbose: false,\n  conflictStrategy: 'error', // 'error' | 'rename' | 'ignore';\n  outputFormat: 'yaml'       // 'yaml' | 'json'\n};\noptions.verbose = opts.verbose;\nresolver\n  .resolve(options)\n  .then((resolved) => {\n    fs.writeFileSync(outputFileName, yaml.dump(resolved.api), 'utf8');\n  })\n  .catch((ex) => {\n    console.error(ex.message);\n    process.exit(1);\n  });\n```\n\nor with `async`/`await`:\n\n```javascript\n// ..initialize as above, but inside an async function:\ntry {\n  const resolved = await resolve(options);\n  fs.writeFileSync(outputFileName, yaml.dump(resolved.api), 'utf8');\n} catch (e) {\n  // handle error e\n}\n```\n\n## Notes\n\nBelow, a _normalized path_ is defined as the simplified\nversion of a file-path or URL, i.e. with `../` path elements collapsed.\nThe normalized path for `../a/b/c/../../d/e`  is `../a/d/e`.\n\nLocal references that begin with `#`, such as `{ $ref: \"#/path/to/element\" }`,\nare left as-is.\n\nThere are three types of replacements:\nComponent Replacements,\nFull resource replacements,\nand Other embedded objects.\n\n### Component replacements\n\n_Component replacements_ are of the form\n`{ $ref: \"uri#/components/section/componentName\" }` (`section` may be `schemas`,\n`parameters`, `response`, or any other item in `components`).\nComponent replacements are only done for three-level JSON Pointers; for longer JSON pointers, see #4 below.\n\nIf the containing $ref object is at `/components/section/componentName0`, it does not contain any other keys, and\n`componentName0` equals `componentName`, the entire referenced object is inserted\nin place of the original `$ref` object and the mapping `uri#/components/section/componentName` &rArr; `#/components/section/componentName`\nis remembered.\n\nThis is useful to reuse security schemes in OpenAPI 3.1, which are reference by names instead of a `$ref`.\nFor example, if `common.yaml` contains the definition of the `apiKey` security schema:\n\n```yaml\ncomponents:\n  securitySchemes:\n    apiKey:\n      type: apiKey\n      name: API-Key\n      in: header\n      description: 'API Key based client identification.'\n```\n\nthen other API source files can reference this via\n\n```yaml\npaths:\n  '/some/path':\n    get:\n      security:\n        apiKey: []\ncomponents:\n  securitySchemes:\n    apiKey:\n      $ref: '../common.yaml#/components/securitySchemes/apiKey'\n```\n\nThis tool will replace the `$ref` definition of `apiKey`\nwith the one from `common.yaml`:\n\n```yaml\npaths:\n  '/some/path':\n    get:\n      security:\n        apiKey: []\ncomponents:\n  securitySchemes:\n      type: apiKey\n      name: API-Key\n      in: header\n      description: 'API Key based client identification.'\n      x-resolved-from: common.yaml#/components/securitySchemes/apiKey\n```\n\nIn a more complicated case (where the `$ref` contains other properties,\npreventing a simple replacement),\nthe content at the external URI is read and the new named component is\ninserted into the target document's components object. The non-local `$ref` ( `../common.yaml#/components/responses/404` in this case) replaced by\na local ref, such as `{ $ref: \"#/components/responses/404\" }`.\n\nFor example, if an API has several operations that can return a 404 when a thing\nis not found, it may define the reusable component response\nwith a clean description of the problem:\n\n```yaml\n\npaths:\n  /thing/{thingId}:\n    get:\n      ...\n      responses:\n        '404':\n          $ref: '#/components/responses/404Thing'\n    put:\n      ...\n      responses:\n        '404':\n          $ref: '#/components/responses/404Thing'\n    patch:\n      ...\n      responses:\n        '404':\n          $ref: '#/components/responses/404Thing'\ncomponents:\n  responses:\n    '404Thing':\n      description: Thing not found at /thing/{thingId}.\n      $ref: 'common.yaml#/components/responses/404'\n```\n\nThe tool will inline the `404` response from `common.yaml` as a component,\nthen replace the remote `$ref` inside thr `404Thing` response with a reference to the local, inlined `404`:\n\n```yaml\ncomponents:\n  responses:\n    '404':\n      description: Not found. There is no such resource at the request URL.\n      content:\n        application/json:\n          schema:\n            $ref: '#/components/schemas/problemResponse'\n      x-resolved-from: common.yaml#/components/responses/404\n    404Thing:\n      description: Thing not found at /thing/{thingId}.\n      $ref: '#/components/responses/404'\n```\n\nThe `ApiRefOptions.conflictPolicy` determines what to do if the `componentName`\nalready exists in the target document:\n\n* it is either renamed with a unique numeric suffix (`rename`);\n* it is an error and the entire process fails (`error`)\n* the conflict is ignored (`ignore`).\n\nNote: The OpenAPI Specification requires that these paths be relative to the\npath in the\n`servers` object, but this tool simply uses relative references\nfrom the source URI.\n\n### Full resource replacements\n\n_Full resource replacements_ are of the form\n`{ $ref: \"uri\" }` with no `#` fragment. If not yet seen, the entire external file\nis inserted, replacing the `$ref` object. The location is\nremembered so that any duplicate references to the normalized\npath are replaced with a local `{ $ref: #/location/of/resolved/resource }`.\nThis is _only_ done if the `$ref` is the _only_ key in the object.\n\n### Other embedded objects\n\nWhen referencing non-component objects, such as\n`{ $ref: \"components.yaml#/paths/~1health/get\" }` to include the `get` operation at\nthe OpenAPI path `/health` the operation object in `components.yaml`.\n\nAfter embedding an external object from `uri`, the tool will also rewrite any\n`$ref` objects within it, relative to the path that the object was read from.\nAny `{ $ref: \"#/...\"}` objects are converted to `{ $ref: \"normalized-path#/...\"}`.\n\n### To Do\n\nThis tool does not yet merge non-`$ref` content from API files. For example, if\none file has a `$ref` to an operation in another file, this tool\ndoes not pull in API elements from the referenced file, such as the\n`tags` and `security` requirements of the referenced operation.\n","readmeFilename":"README.md"}