# OpenAPI Documentation - JSON format (dot notation)
mimeType = application/json

post.operationId = post-v1-idref-orcid-json
post.description = Retrouve l'identifiant ORCID correspondant à l'identifiant idRef envoyé.
post.responses.default.description = Renvoie un JSON, composé d'`id`, `value`, avec `value` étant un ORCID.
post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdOrcids
post.tags.0 = mapping
post.summary = Trouve l'ORCID associé à un idRef.
post.requestBody.required = true
post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdIdRefs

[use]
plugin = basics
plugin = analytics

[env]
path = date
value = thru(d => (new Date()).toISOString().split("T")[0])

[JSONParse]

# Homogenize ID: url, string and number to an url
[assign]
path = value
value = get("value").replace(/[^\d]*/, "http://www.idref.fr/").replace(/[^\d]*$/, "/id")

[expand]
path = value
cacheName = env("date").prepend("post-v1-idref-orcid-json-")

[expand/combine]
path = value
default = n/a
primer = env("TABLE_SERVER_URL", "http://mapping-tables.daf.intra.inist.fr/") \
        .concat("idref-orcid-json.tsv").join("")
file = ./idref-orcid-json.ini

[assign]
path = value
value = get("value.value")

[JSONString]
indent = env('indent', true)
