Newer
Older
web-services / affiliations-tools / v1 / expand.ini
@Nicolas Thouvenin Nicolas Thouvenin on 2 Sep 2022 2 KB fix: libpostal url ws
# OpenAPI Documentation - JSON format (dot notation)
mimeType = application/json

post.operationId = post-v1-expand
post.description = Traitement qui analyse une adresse postal dans une chaine de caractère et qui renvoit un objet enrichi
post.summary = Analyse and parse address given in `value`, when possible
post.tags.0 = adresses
post.requestBody.content.application/json.example.0.id = 1
post.requestBody.content.application/json.example.0.value = University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France
post.requestBody.content.application/json.example.1.id = 2
post.requestBody.content.application/json.example.1.value = Inist-CNRS 2, rue Jean Zay CS 10310 F‑54519 Vandœuvre-lès-Nancy France
post.requestBody.content.application/json.schema.$ref = #/components/schemas/JSONStream
post.requestBody.required = true
post.responses.default.content.application/json.example.0.id = 1
post.responses.default.content.application/json.example.0.value = { ... }
post.responses.default.content.application/json.example.0.id = 2
post.responses.default.content.application/json.example.0.value = { ... }
post.responses.default.content.application/json.schema.$ref =  #/components/schemas/JSONStream
post.responses.default.description = Les adresses sous forme d'un objet contenant les champs trouvés
post.parameters.0.description = Indenter le JSON résultant
post.parameters.0.in = query
post.parameters.0.name = indent
post.parameters.0.schema.type = boolean

# Necessary plugins
[use]
plugin = basics
plugin = analytics

# Flow configuration
[JSONParse]
separator = *

# ---------  Découpage du champ  avec libpostal (decoupage en champs)
[expand]
path = value
size = 10
cacheName = post-v1-expand-libpostal
[expand/URLConnect]
url = https://affiliations-tools.services.inist.fr/v1/addresses/parse
timeout = 5000

# ---------  Enrichissement du resultat libpostal
[expand]
path = value
# size = 1 est obligatoire pour traiter séparement chaque élement du tableau
size = 1

[expand/assign]
path = value.value.id
value = get('value.id')

[expand/assign]
path = value
value = get('value.value')

[expand/assign]
path = value.country
value = get('value.country').replace(/\W/g, ' ').trim()

# --------- Enrichissement du champ country avec le vocabulaire 9SD de Loterre
[expand/expand]
path = value.country
size = 10
cacheName = post-v1-expand-loterre

[expand/expand/URLConnect]
url = https://loterre-resolvers.services.inist.fr/v1/9SD/identify
timeout = 5000

[dump]
indent = env('indent', false)