Skip to content

REST endpoint /supportedentities only supports english #1058

Description

@paulo-raca

Describe the bug

I was looking at the /supportedentities REST API and tried adding ?language=es and ?language=it to get the Spain / Italy-specific entities I saw in the docs.

Turns out that it doesn't really work. Anything but en returns {"error":"No matching recognizers were found to serve the request."} (HTTP 500)

To Reproduce

$ curl http://localhost:3001/supportedentities?language=en
["US_PASSPORT","DATE_TIME","MEDICAL_LICENSE","AU_ABN","IBAN_CODE","CREDIT_CARD","AU_TFN","AU_ACN","PHONE_NUMBER","AU_MEDICARE","IP_ADDRESS","URL","CRYPTO","US_SSN","PERSON","NRP","LOCATION","EMAIL_ADDRESS","US_DRIVER_LICENSE","US_BANK_NUMBER","SG_NRIC_FIN","US_ITIN","UK_NHS"]
$ curl http://localhost:3001/supportedentities?language=it
{"error":"No matching recognizers were found to serve the request."}
$ curl http://localhost:3001/supportedentities?language=es
{"error":"No matching recognizers were found to serve the request."}
curl http://localhost:3001/supportedentities?language=xy
{"error":"No matching recognizers were found to serve the request."}

Expected behavior

  • For language=it, I should get the italian entities: ["IT_FISCAL_CODE","IT_DRIVER_LICENSE","IT_VAT_CODE","IT_PASSPORT","IT_IDENTITY_CARD"]
  • For language=es, I should get the espanish entities: ["ES_NIF"]
  • For language=xy, I should get an empty list: []

I'm not entirely sure if the global entities (email, phone number, URL, etc) should be returned too, since they have supported_language='en' in the code. But this is probably another issue 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions