Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - 500 error code fetching Dictionary #235

Open
leoraba opened this issue Oct 24, 2024 · 1 comment
Open

BUG - 500 error code fetching Dictionary #235

leoraba opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@leoraba
Copy link
Contributor

leoraba commented Oct 24, 2024

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')"
}

@leoraba leoraba added the bug Something isn't working label Oct 24, 2024
@leoraba leoraba changed the title BUG - GET /dictionaries returns 500 error Cannot read properties of undefined (reading 'codeList') BUG - GET /dictionaries returns 500 error Oct 24, 2024
@leoraba leoraba changed the title BUG - GET /dictionaries returns 500 error BUG - 500 error code fetching Dictionary Oct 24, 2024
@leoraba
Copy link
Contributor Author

leoraba commented Oct 24, 2024

Findings: Error found on the Dictionary data, not a Lectern application issue.
Fixed changing Conditional Restrictions the match property from values to value

edsu7 added a commit to virusseq/metadata-schemas that referenced this issue Oct 25, 2024
- correct "values" to "value" as per overture-stack/lectern#235
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant