Skip to content

[Bug]: /api/inventory fails with 200/OK response #252

@barry-luijten

Description

@barry-luijten

What happened?

After posting a partial update to the /api/inventory endpoint (format json), the API responds OK, with the changes mentioned correctly, but the result is not processed in the inventory yaml. On the RackPeek console (docker stdout), this error is observed:

fail: DocMigrator.Yaml.YamlMigrationDeserializer[0]
      Failed to deserialize YamlRoot
      (Line: 3, Col: 3, Idx: 24) - (Line: 3, Col: 3, Idx: 24): Exception during deserialization

RackPeek version: 1.2.0
OS: Ubuntu 24.04

Where does this occur?

Web UI

How do you run RackPeek?

Docker

RackPeek version

1.2.0

Steps to reproduce (optional)

POST /api/inventory
Header: X-API-KEY: xxx
Body:

{
  "json": {
    "version": 2,
    "resources": [
      {
        "kind": "Server",
        "name": "server1"
      }
    ]
  }
}

Response:
Responsecode: 200
Body:

{
  "added": [
    "server1"
  ],
  "updated": [],
  "replaced": [],
  "oldYaml": {},
  "newYaml": {
    "server1": "name: server1\n"
  }
}

Screenshots (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions