Skip to content

Conversation

@fhennig
Copy link
Contributor

@fhennig fhennig commented Feb 10, 2026

resolves #1518

Adds a new /query/parse endpoint where you can pass a list of strings (in a POST request) to be parsed. The response is also a list, with either a filter or an error.

Screenshot

Swagger UI with new controller:

image

Example

request:

curl -X 'POST' \
  'http://localhost:8090/query/parse' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "queries": [
    "(C25T | C25G) & C27G"
  ]
}'

response:

{
  "data": [
    {
      "filter": {
        "children": [
          {
            "position": 27,
            "symbol": "G",
            "type": "NucleotideEquals"
          },
          {
            "children": [
              {
                "position": 25,
                "symbol": "G",
                "type": "NucleotideEquals"
              },
              {
                "position": 25,
                "symbol": "T",
                "type": "NucleotideEquals"
              }
            ],
            "type": "Or"
          }
        ],
        "type": "And"
      }
    }
  ],
  "info": {
    "dataVersion": null,
    "requestId": "68880abc-1bb7-4645-a261-eb1517b0c259",
    "requestInfo": "sars_cov-2_minimal_test_config on localhost at 2026-02-10T13:48:44.253903636",
    "reportTo": "Please report to https://github.com/GenSpectrum/LAPIS/issues in case you encounter any unexpected issues. Please include the request ID and the requestInfo in your report.",
    "lapisVersion": "unspecified",
    "siloVersion": "928d36991a802dcf83fa7f34f8ac7420d8a6bc84"
  }
}

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lapis Ready Ready Preview, Comment Feb 12, 2026 1:25pm

Request Review

This comment was marked as outdated.

Copy link
Contributor

@fengelniederhammer fengelniederhammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm missing an e2e test (one test that sends a complex valid query and an invalid one might be enough). Otherwise this looks good!

@fengelniederhammer
Copy link
Contributor

Let's also add something to the LAPIS docs. Maybe a paragraph on the advanced queries page that tells the user that there is an endpoint to validate them?

@fhennig
Copy link
Contributor Author

fhennig commented Feb 12, 2026

I addressed all the comments, added an e2e test and added docs. You can have another look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New endpoint to validate advanced queries

2 participants