nds-org / workbench-webui

Web UI for the Workbench platform
0 stars 1 forks source link

Import Spec fails when some parts of spec are invalid #27

Open bodom0015 opened 10 months ago

bodom0015 commented 10 months ago

Found while testing https://github.com/cheese-hub/catalog/pull/20/files

Step to Reproduce

  1. Navigate to /my-catalog and click Import Spec
    • You should see a dialog appear that allows you to import this new spec
  2. Paste the spec JSON from the above PR
  3. Click "Import" at the bottom right of the dialog

Expected Results

Spec validation error should be displayed on screen (or we workaround the format errors and fix them for the user)

Actual Results

Screen turns white and page does not finish loading

API Response:

{
  "detail": "1000 is not of type 'string' - 'resourceLimits.cpuMax'",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

Frontend error caused by API Response:

Failed to import new spec with key=svmpoisoningexample:  Error: Validation failed - spec is invalid
    at se (main.954c9ebe.chunk.js:1:10855)
    at main.954c9ebe.chunk.js:1:11297
    at p (2.03cca15f.chunk.js:2:1550)
    at Generator.<anonymous> (2.03cca15f.chunk.js:2:2897)
    at Generator.next (2.03cca15f.chunk.js:2:1913)
    at r (2.03cca15f.chunk.js:2:8517)
    at s (2.03cca15f.chunk.js:2:8720)