diff --git a/affiliations-tools/swagger.json b/affiliations-tools/swagger.json index 3778d46..75ef6bf 100644 --- a/affiliations-tools/swagger.json +++ b/affiliations-tools/swagger.json @@ -1,147 +1,170 @@ { + "servers": [ + { + "url": "{scheme}://{hostname}", + "variables": { + "scheme": { + "default": "https" + } + } + } + ], + "tags": [ + { + "name": "affiliations", + "description": "Affiliations", + "externalDocs": { + "description": "Plus de documentation", + "url": "https://gitbucket.inist.fr/tdm/web-services/tree/master/affiliations-tools" + } + } + ], "components": { - "NoticesRnsr": { - "type": "array", - "items": { - "$ref": "#/components/NoticeRnsr" - } - }, - "NoticeRnsr": { - "type": "object", - "properties": { - "xPublicationDate": { - "type": "array", - "items": { + "schemas": { + "NoticesRnsr": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NoticeRnsr" + } + }, + "NoticeRnsr": { + "type": "object", + "properties": { + "xPublicationDate": { + "type": "array", + "items": { + "type": "string", + "format": "date" + } + }, + "authors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AuthorRnsr" + } + } + } + }, + "Notices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Notice" + } + }, + "Notice": { + "type": "object", + "properties": { + "xPublicationDate": { + "type": "array", + "items": { + "type": "string", + "format": "date" + } + }, + "authors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Author" + } + } + } + }, + "Author": { + "type": "object", + "properties": { + "affiliations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Affiliation" + } + } + } + }, + "AuthorRnsr": { + "type": "object", + "properties": { + "affiliations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AffiliationRnsr" + } + } + } + }, + "Affiliation": { + "type": "object", + "properties": { + "address": { + "type": "string" + } + } + }, + "AffiliationRnsr": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "conditorRnsr": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RNSR" + } + } + } + }, + "RNSR": { + "type": "string", + "pattern": "^[0-9]{9}[A-Z]$", + "example": "200919362L" + }, + "IdYearAddresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IdYearAddress" + } + }, + "IdYearAddress": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "value": { + "$ref": "#/components/schemas/YearAddress" + } + } + }, + "YearAddress": { + "type": "object", + "properties": { + "year": { "type": "string", "format": "date" - } - }, - "authors": { - "type": "array", - "items": { - "$ref": "#/components/AuthorRnsr" - } - } - } - }, - "Notices": { - "type": "array", - "items": { - "$ref": "#/components/Notice" - } - }, - "Notice": { - "type": "object", - "properties": { - "xPublicationDate": { - "type": "array", - "items": { + }, + "address": { "type": "string", - "format": "date" - } - }, - "authors": { - "type": "array", - "items": { - "$ref": "#/components/Author" + "example": "University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France" } } - } - }, - "Author": { - "type": "object", - "properties": { - "affiliations": { - "type": "array", - "items": { - "$ref": "#/components/Affiliation" - } + }, + "IdRNSRs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/IdRNSR" } - } - }, - "AuthorRnsr": { - "type": "object", - "properties": { - "affiliations": { - "type": "array", - "items": { - "$ref": "#/components/AffiliationRnsr" - } - } - } - }, - "Affiliation": { - "type": "object", - "properties": { - "address": { - "type": "string" - } - } - }, - "AffiliationRnsr": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "conditorRnsr": { - "type": "array", - "items": { - "$ref": "#/components/RNSR" - } - } - } - }, - "RNSR": { - "type": "string", - "pattern": "^[0-9]{9}[A-Z]$", - "example": "200919362L" - }, - "IdYearAddresses": { - "type": "array", - "items": { - "$ref": "#/components/IdYearAddress" - } - }, - "IdYearAddress": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "value": { - "$ref": "#/components/YearAddress" - } - } - }, - "YearAddress": { - "type": "object", - "properties": { - "year": { - "type": "string", - "format": "date" - }, - "address": { - "type": "string" - } - } - }, - "IdRNSRs": { - "type": "array", - "items": { - "$ref": "#/components/IdRNSR" - } - }, - "IdRNSR": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "value": { - "type": "array", - "items": { - "$ref": "#/components/RNSR" + }, + "IdRNSR": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RNSR" + } } } } diff --git a/affiliations-tools/v1/rnsr/conditor.ini b/affiliations-tools/v1/rnsr/conditor.ini index 34435b2..6a5fcec 100644 --- a/affiliations-tools/v1/rnsr/conditor.ini +++ b/affiliations-tools/v1/rnsr/conditor.ini @@ -1,10 +1,14 @@ # OpenAPI Documentation - JSON format (dot notation) mimeType = application/json + +post.operationId = post-v1-rnsr-conditor +post.description = Prend en entrée une notice Conditor, et y ajoute un champ `conditorRnsr` +post.tags.0 = affiliations post.responses.default.description = Return a Conditor JSON notice, added with `conditorRnsr` field -post.responses.default.content.application/json.schema.$ref = #/components/NoticesRnsr +post.responses.default.content.application/json.schema.$ref = #/components/schemas/NoticesRnsr post.summary = Find RNSR to address given in `authors.affiliations`, when possible post.requestBody.required = true -post.requestBody.content.application/json.schema.$ref = #/components/Notices +post.requestBody.content.application/json.schema.$ref = #/components/schemas/Notices [use] plugin = basics diff --git a/affiliations-tools/v1/rnsr/csv.ini b/affiliations-tools/v1/rnsr/csv.ini index 7c269fe..ba19908 100644 --- a/affiliations-tools/v1/rnsr/csv.ini +++ b/affiliations-tools/v1/rnsr/csv.ini @@ -1,5 +1,9 @@ # 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.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 diff --git a/affiliations-tools/v1/rnsr/json.ini b/affiliations-tools/v1/rnsr/json.ini index a3970ce..a07d221 100644 --- a/affiliations-tools/v1/rnsr/json.ini +++ b/affiliations-tools/v1/rnsr/json.ini @@ -1,14 +1,14 @@ # OpenAPI Documentation - JSON format (dot notation) mimeType = application/json + +post.operationId = post-v1-rnsr-json +post.description = Traitement qui renvoie prend un objet JSON content un `id` et une `value` (contenant une année de publication, `year`, et une adresse `address`) et renvoie un `id` et une `value` (un tableau d identifiants RNSR). +post.tags.0 = affiliations post.responses.default.description = Return a JSON, composed of `id`, `value`, where value is found `RNSR`(s) -post.responses.default.content.application/json.schema.$ref = #/components/IdRNSRs +post.responses.default.content.application/json.schema.$ref = #/components/schemas/IdRNSRs post.summary = Find RNSR to address given in `value`, when possible post.requestBody.required = true -post.requestBody.content.application/json.schema.$ref = #/components/IdYearAddresses -post.requestBody.content.examples.bordeaux.summary = University of Bordeaux address -post.requestBody.content.examples.bordeaux.value.id = 3 -post.requestBody.content.examples.bordeaux.value.value.address = University of Bordeaux, IMS, CNRS UMR5218, Talence, F-33405, France -post.requestBody.content.examples.bordeaux.value.value.year = 2021 +post.requestBody.content.application/json.schema.$ref = #/components/schemas/IdYearAddresses [use] plugin = basics