Skip to content

BUG - 500 error code fetching Dictionary #235

Open
@leoraba

Description

@leoraba

Issue:
GET /dictionaries returns 500 error Cannot read properties of undefined (reading 'codeList')

Description:
Lectern is storing Dictionary with missing property values on if.conditions.match. This missing property on match object throws the described error 500.

Steps to reproduce:

  1. Create new Dictionary on Lectern POST /dictionaries with an IF condition having match with values. e.g.
"restrictions": [
    {
      "if": {
        "conditions": [
          {
            "fields": [
              "organism"
            ],
            "match": {
              "values": "Influenza A virus"
            }
          }
        ]
      },
      "then": {
        "required": true,
        "codeList": "#/list/influenza_a_virus_gene_list"
      }
    }
  ]

Expect response: 200 OK
Actual response: 200 OK

  1. GET /dictionaries with the name/version provided.

Expect: 200 OK
Actual Response: 500 Internal Server Error
{
"error": "TypeError",
"message": "Cannot read properties of undefined (reading 'codeList')"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions