DeveloperLaPoste / okapi-feedback

Feedback, ideas, propositions about Okapi platform and La Poste Open APIs (https://developer.laposte.fr/)
0 stars 1 forks source link

problem de la serialization json pour les collections #8

Open FredBell opened 7 years ago

FredBell commented 7 years ago

First in English and after in my poor french...

I think you have an issue with how your json response is serialized for the controlAddress API. The sequence number is included in the Json - which is not really a valid Json object. The Json spec states that the sequence is the same in input and output - therefore adding the sequence number is useless - as a result - and by convention - the sequence number is never added into a Json array. Currently your API is forcing the use of a dictionary to get the data.

For example I get {"0":{"code":"61873126","adresse":"123 BOULEVARD DES CAPUCINES 75002 PARIS"},"1":{"code":"61873127","adresse":"123 BOULEVARD DES CAPUCINES 75009 PARIS"},"2":{"code":"61873128","adresse":"123 BATIMENT A 39 BOULEVARD DES CAPUCINES 75002 PARIS"},"3":{"code":"61873129","adresse":"123 BNP 6 BOULEVARD DES CAPUCINES 75450 PARIS CEDEX 09"},"4":{"code":"61873130","adresse":"123 5 BOULEVARD DES CAPUCINES 75002 PARIS"},"5":{"code":"61873131","adresse":"123 11 BOULEVARD DES CAPUCINES 75002 PARIS"},"6":{"code":"61873132","adresse":"123 17 BOULEVARD DES CAPUCINES 75002 PARIS"},"7":{"code":"61873133","adresse":"123 21 BOULEVARD DES CAPUCINES 75002 PARIS"},"8":{"code":"61873134","adresse":"123 37 BOULEVARD DES CAPUCINES 75002 PARIS"},"9":{"code":"61873135","adresse":"123 39 BOULEVARD DES CAPUCINES 75002 PARIS"}}

Instead I should simply get an array of [{"code":"61873135","adresse":"123 39 BOULEVARD DES CAPUCINES 75002 PARIS"}, {anotherone}, {andAnotherone},...] without any sequence number.

Second: there is an issue with your forum - it is not possible to login without sharing personal information about your twitter account or worse (the github account). This is a real security issue and it is the major reason almost no one that is computer literate will participate in your project. It is a shame becuase many people with great technical skills would otherwise participate if you let them login with their laposte account.

Now in my bad french - apologies in advance... Il y a un problem technique dans la serialization de vos objects - par example pour les addresses - la sequnce de la collection est incluse - malheuresement cela break la convention pour la serializtion des array en Json. Par la specification Json - la sequence est manitenu en input et output - et donc la sequence n'ai jamais incluse - pusique elle ne sert a rien. Pour le moment - votre serializtion force les utilisateurs a creer des dictionary objets pour deserializer proprement.

Il n'est pas correct d'avoir cette sequence. Le Json devrait etre comme cela: [{"code":"61873135","adresse":"123 39 BOULEVARD DES CAPUCINES 75002 PARIS"}, {anotherone}, {andAnotherone},...].

Sur un autre sujet - votre forum empeche toute participation de person qui connaise bien la tehcnologie - if force le login a d'autre service - ce que person qui connais la securite sur internet ne fera jamais. Le resultat et que seulement des gens incompetent participe au forum et donc votre communaute ne peut pas profiter de l'expertise des autre. Cela est dommage. (De plus les reasau sociaux sont en train de mourir au US - et je pense ailleur aussi - donc il serait preferable de simplement utiliser le login de la poste)