benoitdm-oslandia / pg_featureserv

Apache License 2.0
1 stars 0 forks source link

openapi: fix openapi validation errors and json validation from requests - [merged] #121

Closed benoitdm-oslandia closed 1 year ago

benoitdm-oslandia commented 1 year ago

_Merges fix/invalidopenapi -> develop

close #64

benoitdm-oslandia commented 1 year ago

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

added 2 commits

Compare with previous version

benoitdm-oslandia commented 1 year ago

added 3h of time spent

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 14:38

approved this merge request

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 14:44

Commented on internal/api/openapi.go line 431

Pourquoi il y a un "1" ici ?

En curl ça donne &transform=Centroid|Buffer|1, c'est bizarre non ?

J'imagine que c'est pour donner en entrée le paramètre au buffer, mais ça ne semble pas fonctionner (Invalid value for parameter transform: 1)

benoitdm-oslandia commented 1 year ago

je suis bien d'accord! C'est moche :smile:

Je suis parti du principe que la virgule d'origine servait à séparer les 2 cas d'usages. Après je ne me suis pas penché sur le fonctionnement des transforms pour savoir comment l'exemple devait être interprété.

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 14:52

Commented on internal/api/openapi.go line 431

Je viens de me plonger dans le code ! A priori ce serai plutôt, dans le curl, &transform=Centroid|Buffer,1.

Vu que le style de la liste est pipeDelimited, l'example doit plutôt être

            Example: []string{"Centroid", "Buffer,1"},
benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 14:54

unapproved this merge request

benoitdm-oslandia commented 1 year ago

hum ... quel est le but de cette transform ?

Peut être faire un buffer de 1 à partir du centroid ? parce qu'une transform qui ne fait que centroid c'est bizarre ... donc je laisserais Centroid|Buffer ensemble, après le 1 je ne sais pas ... soit c un parametre de buffer soit c'est un truc par défaut qui veut dire que c'est une transform qui ne fait rien ...

Peut être qu'il faut laisser tout ensemble : Example: []string{"Centroid|Buffer,1"}, ?

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 15:05

Commented on internal/api/openapi.go line 431

D'après le code de param.go, | sépare les noms de transform, et , les paramèrtres des fonctions. Transform qui ne fait que Centroid c'est imaginable pour des requêtes sur des polygones je trouve. Après le cas d'usage de l'exemple ne dois pas exister (fairee un buffer de 1 unité autour du centroid), mais je pense que c'est justement pour l'exemple.

Pour moi la présence du champ Style: "pipeDelimited" montre bien que c'est une liste dont le délimiteur est | dans le paramètre, donc je reste sur mon interprétation

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 15:05

Commented on internal/api/openapi.go line 431

https://git.oslandia.net/Client-projects/geoplateforme-ign-pg-featureserv/-/blob/develop/internal/service/param.go#L360

benoitdm-oslandia commented 1 year ago

ok !

benoitdm-oslandia commented 1 year ago

resolved all threads

benoitdm-oslandia commented 1 year ago

changed this line in version 5 of the diff

benoitdm-oslandia commented 1 year ago

added 1 commit

Compare with previous version

benoitdm-oslandia commented 1 year ago

In GitLab by @azarz on Oct 13, 2022, 15:18

approved this merge request

benoitdm-oslandia commented 1 year ago

added 3 commits

Compare with previous version

benoitdm-oslandia commented 1 year ago

added 3 commits

Compare with previous version

benoitdm-oslandia commented 1 year ago

enabled an automatic merge when the pipeline for c1ddb739ad415c8c9798ed33c5e75baf54edfd67 succeeds