Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI Import file refresh #101

Closed
mmuenker opened this issue Aug 15, 2024 · 4 comments
Closed

OpenAPI Import file refresh #101

mmuenker opened this issue Aug 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mmuenker
Copy link

Describe the bug

In order for changes made in selected OpenAPI files to take effect, it is necessary to restart the IDE.

Steps to reproduce

  1. Import requests from an OpenAPI file.
  2. Change the OpenAPI file
  3. Create a new draft request from a changed operation
  4. Changes in the OpenAPI file are not reflected in the new draft request
  5. Restart the IDE
  6. Create a new draft request from a changed operation
  7. Changes in the OpenAPI file are reflected in the new draft request

Expected behavior

The modifications made to the OpenAPI file should be reflected in the newly created drafts.

Environment information:

  • OS: Pop!_OS 22.04 LTS
  • IDE version: 2024.1.6 (Webstorm)
  • plugin version: 2024.3.2-241
@mmuenker mmuenker added the bug Something isn't working label Aug 15, 2024
@AntonShuvaev
Copy link
Collaborator

Thanks for reporting this issue. The problem occurs because the parser reads the file from disk, and changes made in the editor are not saved immediately. I will fix this in the next version by ensuring changes are saved before importing the OpenAPI file. For now, you can manually save the file (Ctrl + S) to reflect the changes after a refresh.

@mmuenker
Copy link
Author

Thanks for the quick response.

But I don't think that's the problem. The Open API file in question is generated, so the changes are saved to disk.

Is it possible that the plugin is using the IDE's file change detection? Maybe the IDE is not detecting the changes?

@AntonShuvaev
Copy link
Collaborator

Thanks for the feedback.
It's possible to detect changes and automatically update the imported API whenever the OpenAPI file changes. However, this could impact performance when editing the OpenAPI file. For now, I'll keep the current behavior where you need to click the Refresh button in the tool window to update the imported API.
As mentioned earlier, if you make changes to the OpenAPI file in the editor, you need to save those changes to disk (using 'Save All', switching editor tabs, etc.). Only then will the changes be applied when you click the Refresh button. I will fix this in the next version so that you will only need to click the Refresh button without having to save the file first.
If you are making changes using a generation tool, the changes should be written to disk and should be applied after clicking the Refresh button. Did you try clicking the Refresh button in the tool window?

@mmuenker
Copy link
Author

Understandable. Thank you.

Did you try clicking the Refresh button in the tool window?

No, I hadn't tried it before, but I gave it a try and it worked as I had expected. I'm not sure how I had overlooked the button previously ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants