research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
23 stars 14 forks source link

Codemeta: Server error when programming languages stored in percentage #1173

Closed cmeessen closed 5 months ago

cmeessen commented 5 months ago

If a software entry has floating numbers in their programming languages statistics, the codemeta endpoint returns a server error.

Here are some exmaples:

The error logs:

2024/04/15 11:48:26 Unknown error for slug opengeosys: json: cannot unmarshal number 29.75 into Go struct field .repository_url.languages of type uint64
2024/04/15 11:55:08 Unknown error for slug remix: json: cannot unmarshal number 53.9 into Go struct field .repository_url.languages of type uint64
2024/04/18 09:23:51 Unknown error for slug amiris: json: cannot unmarshal number 96.47 into Go struct field .repository_url.languages of type uint64

https://helmholtz.software/api/v1/repository_url?software=eq.206cecce-03ab-4cb3-9586-4c173522fd18:

[
  {
    "software": "206cecce-03ab-4cb3-9586-4c173522fd18",
    "url": "https://gitlab.com/dlr-ve/esy/amiris/amiris",
    "code_platform": "gitlab",
    "languages": {
      "Java": 96.47,
      "BibTeX": 1.35,
      "Python": 2.18
    },
...
]