Newer
Older
web-services / affiliations-tools / v1 / rnsr / csv.ini
@François Parmentier François Parmentier on 25 Jan 1 KB docs(affiliations-tools): Add tags
# OpenAPI Documentation - JSON format (dot notation)
mimeType = text/csv

post.operationId = post-v1-rnsr-csv
post.description = Traitement qui prend un CSV avec 2 colonnes (`Année` et `Adresse`), et l enrichit avec une colonne `RNSR`.
post.tags.0 = affiliations
post.tags.1 = rnsr
post.responses.default.description = Return a CSV, composed of `Année`, `Adresse`, and enriched with a `RNSR` field.
post.responses.default.content.text/csv.schema.$ref = #/components/schemas/anyValue
post.summary = Adds RNSR to addresses field, when possible
post.requestBody.required = true
post.requestBody.content.text/csv.schema.$ref = #/components/schemas/anyValue

[use]
plugin = basics
plugin = conditor

[CSVParse]
[CSVObject]
[replace]
path = xPublicationDate
value = get("Année").toArray().reduce((array, char) => ([array[0]+char]), [""])

path = authors
value = get("Adresse").toArray("Chaîne").reduce((s,c) => [{affiliations:[{address:s[0].affiliations[0].address+c}]}], [{affiliations:[{address:""}]}])

[affAlign]

[replace]
path = Année
value = get("xPublicationDate")

path = Adresse
value = get("authors.0.affiliations.0.address")

path = RNSR
value = get("authors.0.affiliations.0.conditorRnsr")

[CSVString]