rohit-gohri / redocusaurus

OpenAPI for Docusaurus with Redoc
https://redocusaurus.vercel.app/
MIT License
629 stars 114 forks source link

update paths to watch for handling multi-file OpenAPI docs #219

Closed mauris closed 2 years ago

mauris commented 2 years ago

Implements #213

The bundle function in @redocly/openapi-core package provides the property fileDependencies, where it can be used to provide to Docusaurus through getPathsToWatch() a list of files to watch for changes because they are referenced from the main OpenAPI file through $ref references.

However changes to the list of files watched does not get updated by Docusaurus while running.

Test case:

  1. Run the example site in dev using yarn dev
  2. make changes in website/openapi/multi-file/components/pets.yaml
  3. hot reload occurs and changes show up on example site
changeset-bot[bot] commented 2 years ago

🦋 Changeset detected

Latest commit: 5d64e44e9064e86ffd33b34d2f04029bf40405f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ----------------------- | ----- | | docusaurus-plugin-redoc | Patch | | redocusaurus | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 2 years ago

Someone is attempting to deploy a commit to a Personal Account owned by @rohit-gohri on Vercel.

@rohit-gohri first needs to authorize it.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
redocusaurus ✅ Ready (Inspect) Visit Preview Jul 9, 2022 at 4:40PM (UTC)
rohit-gohri commented 2 years ago

However changes to the list of files watched does not get updated by Docusaurus while running.

That was easy enough to fix, I just added the spec file too. Thanks for the PR