Skip to content

Conversation

@waldekmastykarz
Copy link
Collaborator

Fixes hot reload of CRUD API data file. Closes #1390

@waldekmastykarz waldekmastykarz requested a review from a team as a code owner December 30, 2025 12:26
Copilot AI review requested due to automatic review settings December 30, 2025 12:26
@waldekmastykarz waldekmastykarz added the pr-bugfix Fixes a bug label Dec 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the CRUD API plugin to enable hot reload of the data file by introducing a dedicated CrudApiDataLoader class that leverages the existing BaseLoader infrastructure with file watching capabilities. The changes separate concerns between API definition loading and data loading, allowing both to be independently monitored and reloaded.

Key changes:

  • Introduced CrudApiDataLoader to handle data file loading with hot reload support
  • Renamed _loader to _definitionLoader in CrudApiPlugin for clarity
  • Updated BaseLoader to skip schema validation for JSON arrays (data files)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
DevProxy.Plugins/Mocking/CrudApiPlugin.cs Refactored to use separate loaders for API definition and data, removing inline LoadData() method
DevProxy.Plugins/Mocking/CrudApiDataLoader.cs New loader class that extends BaseLoader to provide hot reload functionality for CRUD API data files
DevProxy.Abstractions/Plugins/BaseLoader.cs Updated schema validation to skip JSON arrays, enabling validation of data files

Copy link
Contributor

@garrytrinder garrytrinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm. I tested changing data and changing actions, all worked perfectly.

@waldekmastykarz waldekmastykarz enabled auto-merge (squash) January 7, 2026 09:13
@waldekmastykarz waldekmastykarz merged commit da09a89 into dotnet:main Jan 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Dev Proxy does not restart when updating CRUD API data file

2 participants