psychonautwiki / bifrost

The PsychonautWiki API.
MIT License
48 stars 10 forks source link

Substance class strings have trailing hash character #17

Closed wjlafrance closed 4 years ago

wjlafrance commented 4 years ago

This can be replicated with this query, encoded and linked here:

{
  substances(query: "LSD") {
    class {
      chemical
      psychoactive
    }
  }
}

The API currently responds:

{"data":{"substances":[{"class":{"chemical":["Lysergamide#"],"psychoactive":["Psychedelics#"]}}]}}

The trailing # character is unexpected. This has been noticed in DoseBot for a few months now, and I believe it's a regression, but I'm not sure when it started happening.

19h commented 4 years ago

It definitely started when I upgraded the semantics platform. I'll fix it.

wjlafrance commented 4 years ago

@19h thanks for the patch! It's confirmed fixed on my end.

dlbnco commented 4 years ago

I think it was fixed but just partially. It still showing up in some classes

{
  substances(query: "Mirtazapine") {
    class {
      chemical
      psychoactive
    }
  }
}
{
  "data": {
    "substances": [
      {
        "class": {
          "chemical": [
            "Piperazinoazepine"
          ],
          "psychoactive": [
            "Antidepressant#,Sedative#,Psychedelics"
          ]
        }
      }
    ]
  }
}
19h commented 4 years ago

It also not supposed to deliver the classes as a single string..

19h commented 4 years ago

I’m currently traveling in the arctic circle and have limited access to computer infrastructure. I will fix this issue when I’m back. Thanks for reporting the issue!

19h commented 4 years ago

Issue should be resolved.