From 66268c724534cf0bfb8a908da46f7f4f863fb59a Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Oct 2023 14:15:33 +0200 Subject: [PATCH] Bug 30708: Fix API specs --- .../definitions/preservation_train.yaml | 2 +- .../definitions/preservation_train_item.yaml | 35 +++++++++++++++++++ api/v1/swagger/paths/preservation_trains.yaml | 7 +++- api/v1/swagger/swagger.yaml | 2 ++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 api/v1/swagger/definitions/preservation_train_item.yaml diff --git a/api/v1/swagger/definitions/preservation_train.yaml b/api/v1/swagger/definitions/preservation_train.yaml index 9502a710a3e..2b249a7e4c7 100644 --- a/api/v1/swagger/definitions/preservation_train.yaml +++ b/api/v1/swagger/definitions/preservation_train.yaml @@ -3,7 +3,7 @@ type: object properties: train_id: type: integer - description: internally assigned agreement identifier + description: internally assigned train identifier readOnly: true name: description: name of the train diff --git a/api/v1/swagger/definitions/preservation_train_item.yaml b/api/v1/swagger/definitions/preservation_train_item.yaml new file mode 100644 index 00000000000..0afdc6fdf21 --- /dev/null +++ b/api/v1/swagger/definitions/preservation_train_item.yaml @@ -0,0 +1,35 @@ +--- +type: object +properties: + train_item_id: + type: integer + description: internally assigned train item identifier + readOnly: true + train_id: + type: integer + description: internally train identifier + item_id: + type: integer + description: internally item identifier + user_train_item_id: + type: integer + description: internally user train item identifier + processing_id: + description: internally processing identifier + type: integer + added_on: + description: add date + type: + - string + - "null" + attributes: + description: attribute list + type: + - array + - "null" + +additionalProperties: false +required: + - train_id + - processing_id + diff --git a/api/v1/swagger/paths/preservation_trains.yaml b/api/v1/swagger/paths/preservation_trains.yaml index 91a2d8b9345..f4e170a56e9 100644 --- a/api/v1/swagger/paths/preservation_trains.yaml +++ b/api/v1/swagger/paths/preservation_trains.yaml @@ -572,6 +572,7 @@ - catalogue_item - catalogue_item.biblio collectionFormat: csv + additionalProperties: false responses: 200: description: An item in train @@ -624,11 +625,15 @@ required: true schema: type: object + properties: + train_id: + description: Train id + type: integer responses: 201: description: A successfully copied item schema: - type: object + $ref: "../swagger.yaml#/definitions/preservation_train_item" 400: description: Bad parameter schema: diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index 4c9e7bcb6e9..351f796c56e 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -102,6 +102,8 @@ definitions: $ref: ./definitions/preservation_config.yaml preservation_train: $ref: ./definitions/preservation_train.yaml + preservation_train_item: + $ref: ./definitions/preservation_train_item.yaml preservation_processing: $ref: ./definitions/preservation_processing.yaml quote: -- 2.34.1