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

post.operationId = post-v1-halauthorid-idref-json
post.requestBody.content.application/json.example.0.id = 0
post.requestBody.content.application/json.example.0.value = https://data.archives-ouvertes.fr/author/1458607
post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdChaines
post.requestBody.required = true
post.responses.default.content.application/json.example.0.id = 0
post.responses.default.content.application/json.example.0.value = http://www.idref.fr/190260483/id
post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdChaines
post.description = Renvoie l'identifiant idRef correspondant à l'identifiant halAuthorId envoyé.
post.responses.default.description = Renvoie un JSON, composé d `id`, `value`, avec `value` étant un idRef.
post.tags.0: mapping
post.summary: Trouve un idRef associé à un halAuthorId.

[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").split('/').last().replace(/^[^\d]*(?=[\d])/,"https://data.archives-ouvertes.fr/author/")

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

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

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

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