Skip to content

[BUG]: CrudApiPlugin shows two error messages for a non-existent API file #493

@waldekmastykarz

Description

@waldekmastykarz

Description

When you specify a non-existent API file, CrudApiPlugin shows two warning messages

Expected behaviour

Single message with the correct path.

Actual behaviour

  WARNING: File /Users/waldek/github/waldekmastykarz/northwinddb/api.json not found. No CRUD API will be provided
  WARNING: File /Users/waldek/github/waldekmastykarz/northwinddb not found. CRUD API will be disabled

Steps to reproduce

{
  "$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json",
  "plugins": [
    {
      "name": "CrudApiPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
      "configSection": "categoriesApi"
    }
  ],
  "urlsToWatch": [
    "https://api.northwind.com/*"
  ],
  "categoriesApi": {
    "apiFile": "nonexistent-api.json"
  }
}

Dev Proxy Version

latest from main

Operating system (environment)

macOS

Shell

zsh

Configuration file

{
  "$schema": "https://raw.githubusercontent.com/microsoft/dev-proxy/main/schemas/v1.0/rc.schema.json",
  "plugins": [
    {
      "name": "CrudApiPlugin",
      "enabled": true,
      "pluginPath": "~appFolder/plugins/dev-proxy-plugins.dll",
      "configSection": "categoriesApi"
    }
  ],
  "urlsToWatch": [
    "https://api.northwind.com/*"
  ],
  "categoriesApi": {
    "apiFile": "nonexistent-api.json"
  }
}

Additional Info

No response

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions