# OpenAPI Documentation - JSON format (dot notation) mimeType = application/json post.operationId = post-v1-crossref-works-expand post.description = Récupération des métadonnées associées à un DOI post.summary = Récupération à partir d'un tableau d'objets avec à minima un champ value contenant le DOI post.tags.0 = biblio-tools post.requestBody.content.application/json.example.0.id = 1 post.requestBody.content.application/json.example.0.value = 10.4000/edc.9014 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.schema.$ref = #/components/schemas/JSONStream post.responses.default.description = Les prefixes DOI en version textuel 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 # Rétablissons la coloration syntaxique (une ou deux apostrophes selon les besoins): ' value = fix('').join('') # Necessary plugins [use] plugin = basics # Flow configuration [JSONParse] separator = * # Quelques paramètres modifiables si besoin [env] path = size value = 10 path = indent value = true # Passage des doi en minuscule pour être compatible unpaywall [assign] path = value value = get('value').toLower() # Début du traitement par lot [group] size = env('size') # Création d'une requete avec une liste d'identifiants [replace] path = output.0.rows value = fix(self.length) path = output.0.filter value = self().map('value').filter(Boolean).filter(x => x.match(/^10.\d{4,9}\/[^\s]+$/i)).map(x => 'doi:'.concat(x)).join(',') path = input value = self() [map] path = output # Envoi de la requete [map/URLStream] # see https://github.com/CrossRef/rest-api-doc#api-overview url = https://api.crossref.org/works path = .items.* json = true timeout = 30000 retries = 3 noerror = false [map/OBJFlatten] # Création d'un objet réponse [map/replace] path = id value = get('DOI').toLower() path = value value = self().omit(['indexed', 'reference']) # Croisements des resultats et des dois [exchange] value = get('input').map((i) => ({ ...i, value:_.get(_.find(self.output, {id:i.value}), 'value') })) # Fin du traitement par lot [ungroup] # On marque les réponses qui n'ont pas abouti [swing] test = has('value.DOI') reverse = true [swing/assign] path = value value = fix('n/a') [dump] indent = env('indent', false)