psychonautwiki / bifrost

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

Force array type on some properties to match API schema #51

Closed carlfriess closed 2 years ago

carlfriess commented 2 years ago

The API schema specifies that an array is returned for uncertainInteractions, unsafeInteractions, dangerousInteractions and effects. When only one item is returned by MediaWiki, a single item is returned instead of an array with a single item. As a result, the GraphQL API returns null due to type mismatch. Example: dangerous interactions of LSD.

Alternative considered: Remove call to _flattenIfNeeded() here. However, seems to cause too many issues with other properties.

19h commented 2 years ago

Thanks!

19h commented 2 years ago

Deployed.