Newer
Older
web-services / affiliations-rnsr / v1 / csv.ini
# OpenAPI Documentation - JSON format (dot notation)
post.responses.default.description = Return a CSV, composed of `Année`, `Adresse`, and enriched with a `RNSR` field.
post.responses.default.content.application/json.schema.$ref = #/components/schemas/anyValue
post.summary = Adds RNSR to addresses field, when possible
post.requestBody.required = true
post.requestBody.content.application/json.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]