[AN][Dossiers] Some Actes IDs are duplicated in data
As a test case i'm studying the "Loi Macron" as it's exceptionally complex, and I've found an edge case:
- While browsing the Actes (starting from http://parlapi.fr/rest/an/dossiers/DLR5L14N33632/actes_legislatifs) i was surprised not to find any Acte having the original text (http://parlapi.fr/rest/an/documents/PRJLANR5L14B2447) attached
- As a matter of facts, there actually is an Acte attached to this document (http://parlapi.fr/rest/an/actes/VD172250DI, found through http://parlapi.fr/rest/an/documents/PRJLANR5L14B2447/actes_legislatifs), but this Acte is attached neither to any other parent Acte, nor to any Dossier, which sounds very weird
- Then i found the explanation: as you can see in this file (which is the "Loi Macron" part extracted from
Dossiers_Legislatifs_XIV.json), there are 2 Actes having the same
uid"AN21-33632". As ParlAPI is using this
uidas the PK for
Actemodel, the second Acte having the same
uidoverrides the first one, including its attached Documents.
There are 2 ways of considering this problem:
- It's a bug on opendata-side, ParlAPI shouldn't do anything about it except alerting Assemblée Nationale IT about the bug
- ParlAPI shouldn't trust opendata and use its own PKs
@njoyard what would be your choice?