Implement GET records-editor/records endpoint

Description

Endpoint GET records-editor/marc-records/id should be implemented to retrieve Marc record for QuickMARC editor.

Details: https://folio-org.atlassian.net/wiki/pages/viewpage.action?pageId=1775863

Acceptance criteria:

  1. Define API (RAML, ModuleDescriptor)

  2. Endpoint implemented

  3. Enable endpoints publishing in Jenkinsfile (if needed)

  4. Unit tests coverage at least 80%

  5. API tests created

Notes:
We should proceed development using stabs in case Folijet endpoints are not yet available and add additional story for verification on real endpoints when they are completed by Folijet.

Environment

None

Potential Workaround

None

Attachments

1

Checklist

hide

TestRail: Results

Activity

Show:

Viachaslau Khandramai April 2, 2020 at 11:24 AM

Closing this story after manual verification on folio-testing hosted env.

Viachaslau Khandramai April 2, 2020 at 11:18 AM

API test should be implemented as separate story MODQM-9 after MODINVOICE-154 completion because this issue (creation of module for new tenant) also blocks quick-marc tests.

Viachaslau Khandramai April 1, 2020 at 6:34 PM

Verified on hosted env: https://folio-testing-okapi.aws.indexdata.com

Documentation is available:

GET API verification:
1) Prepare environment:

export OKAPI=https://folio-testing-okapi.aws.indexdata.com
export TOKEN=...

2) Create snapshot in SRS:

curl $OKAPI/source-storage/snapshots -H "X-Okapi-Token: $TOKEN" -w'\n' -H "Content-type: application/json" -XPOST -d '{ "jobExecutionId": "0ba74e30-d2b3-494f-87a5-ad2d58e73038", "status": "PARSING_IN_PROGRESS" }' { "jobExecutionId" : "0ba74e30-d2b3-494f-87a5-ad2d58e73038", "status" : "PARSING_IN_PROGRESS", "processingStartedDate" : "2020-04-01T18:08:18.326+0000", "metadata" : { "createdDate" : "2020-04-01T18:08:18.326+0000", "createdByUserId" : "3e13b2e5-f7bf-51a7-877d-e7b876d29617", "updatedDate" : "2020-04-01T18:08:18.326+0000", "updatedByUserId" : "3e13b2e5-f7bf-51a7-877d-e7b876d29617" } }

3) Create record in SRS:

curl $OKAPI/source-storage/records -H "X-Okapi-Token: $TOKEN" -w'\n' -H "Content-type: application/json" -XPOST -d '{ "id": "53cb4459-90e9-46ef-afab-ca202c30ed04", "snapshotId": "0ba74e30-d2b3-494f-87a5-ad2d58e73038", "matchedId": "4179b9d0-d333-4b44-ad44-cc43c18a3ad9", "generation": 0, "recordType": "MARC", "rawRecord": { "id": "75c2a515-0af8-4490-b130-b68e89498151", "content": "marc data goes here" }, "parsedRecord": { "id": "4da43ec0-898a-40a0-a47f-fdf7c5aa41f6", "content": { "leader": "01741nam a2200373 cb4500", "fields": [ { "001": "101073931X" }, { "003": "DE-601" }, { "005": "20180416162657.0" }, { "008": "180111s2018 sz 000 0 eng d" }, { "020": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "3319643991" }, { "9": "3-319-64399-1" } ] } }, { "020": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "9783319643991" }, { "9": "978-3-319-64399-1" } ] } }, { "020": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "9783319644004 (electronic)" }, { "9": "978-3-319-64400-4" } ] } }, { "035": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "(OCoLC)ocn992783736" } ] } }, { "035": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "(OCoLC)992783736" } ] } }, { "035": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "(DE-599)GBV101073931X" } ] } }, { "040": { "ind1": " ", "ind2": " ", "subfields": [ { "b": "ger" }, { "c": "GBVCP" }, { "e": "rda" } ] } }, { "041": { "ind1": "0", "ind2": " ", "subfields": [ { "a": "eng" } ] } }, { "245": { "ind1": "0", "ind2": "0", "subfields": [ { "a": "Futures, biometrics and neuroscience research" }, { "c": "Luiz Moutinho, Mladen Sokele, editors" } ] } }, { "264": { "ind1": "3", "ind2": "1", "subfields": [ { "a": "Cham" }, { "b": "Palgrave Macmillan" }, { "c": "[2018]" } ] } }, { "300": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "xxix, 224 Seiten" }, { "b": "Illustrationen" } ] } }, { "336": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "Text" }, { "b": "txt" }, { "2": "rdacontent" } ] } }, { "337": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "ohne Hilfsmittel zu benutzen" }, { "b": "n" }, { "2": "rdamedia" } ] } }, { "338": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "Band" }, { "b": "nc" }, { "2": "rdacarrier" } ] } }, { "490": { "ind1": "0", "ind2": " ", "subfields": [ { "a": "Innovative research methodologies in management" }, { "v": " / Luiz Moutinho, Mladen Sokele ; Volume 2" } ] } }, { "500": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "Enthält 9 Beiträge" } ] } }, { "650": { "ind1": " ", "ind2": "7", "subfields": [ { "8": "1.1 x" }, { "a": "Betriebswirtschaftslehre" }, { "0": "(DE-601)091351391" }, { "0": "(DE-STW)12041-5" }, { "2": "stw" } ] } }, { "650": { "ind1": " ", "ind2": "7", "subfields": [ { "8": "1.2 x" }, { "a": "Management" }, { "0": "(DE-601)091376173" }, { "0": "(DE-STW)12085-6" }, { "2": "stw" } ] } }, { "650": { "ind1": " ", "ind2": "7", "subfields": [ { "8": "1.3 x" }, { "a": "Wissenschaftliche Methode" }, { "0": "(DE-601)091401445" }, { "0": "(DE-STW)16727-0" }, { "2": "stw" } ] } }, { "700": { "ind1": "1", "ind2": " ", "subfields": [ { "a": "Moutinho, Luiz" }, { "e": "HerausgeberIn" }, { "4": "edt" }, { "0": "(DE-601)509450954" }, { "0": "(DE-588)131450204" } ] } }, { "700": { "ind1": "1", "ind2": " ", "subfields": [ { "a": "Sokele, Mladen" }, { "e": "HerausgeberIn" }, { "4": "edt" } ] } }, { "830": { "ind1": " ", "ind2": "0", "subfields": [ { "a": "Innovative research methodologies in management" }, { "b": " / Luiz Moutinho, Mladen Sokele" }, { "v": "Volume 2" }, { "9": "2.2018" }, { "w": "(DE-601)1011380293" } ] } }, { "856": { "ind1": "4", "ind2": "2", "subfields": [ { "y": "Inhaltsverzeichnis" }, { "u": "http://www.gbv.de/dms/zbw/101073931X.pdf" }, { "m": "V:DE-601;B:DE-206" }, { "q": "application/pdf" }, { "3": "Inhaltsverzeichnis" } ] } }, { "900": { "ind1": " ", "ind2": " ", "subfields": [ { "a": "GBV" }, { "b": "ZBW Kiel <206>" }, { "d": "!H:! A18-1775" }, { "x": "L" }, { "z": "LC" }, { "s": "206/1" } ] } }, { "954": { "ind1": " ", "ind2": " ", "subfields": [ { "0": "ZBW Kiel <206>" }, { "a": "26" }, { "b": "1740761685" }, { "c": "01" }, { "f": "H:" }, { "d": "A18-1775" }, { "e": "u" }, { "x": "206/1" } ] } } ] } }, "deleted": false, "externalIdsHolder": { "instanceId": "24db5e55-478e-4da1-85b5-3e4ab41987eb" }, "additionalInfo": { "suppressDiscovery": false }, "metadata": { "createdDate": "2020-04-01T18:00:29.770+0000", "createdByUserId": "7d9ce6f2-07ef-544a-aff3-3e141f482f02", "updatedDate": "2020-04-01T18:00:29.770+0000", "updatedByUserId": "7d9ce6f2-07ef-544a-aff3-3e141f482f02" } }' { "id" : "53cb4459-90e9-46ef-afab-ca202c30ed04", "snapshotId" : "0ba74e30-d2b3-494f-87a5-ad2d58e73038", "matchedId" : "4179b9d0-d333-4b44-ad44-cc43c18a3ad9", "generation" : 0, "recordType" : "MARC", "rawRecord" : { "id" : "75c2a515-0af8-4490-b130-b68e89498151", "content" : "marc data goes here" }, "parsedRecord" : { "id" : "4da43ec0-898a-40a0-a47f-fdf7c5aa41f6", "content" : { "leader" : "01741nam a2200373 cb4500", "fields" : [ { "001" : "101073931X" }, { "003" : "DE-601" }, { "005" : "20180416162657.0" }, { "008" : "180111s2018 sz 000 0 eng d" }, { "020" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "3319643991" }, { "9" : "3-319-64399-1" } ] } }, { "020" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "9783319643991" }, { "9" : "978-3-319-64399-1" } ] } }, { "020" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "9783319644004 (electronic)" }, { "9" : "978-3-319-64400-4" } ] } }, { "035" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "(OCoLC)ocn992783736" } ] } }, { "035" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "(OCoLC)992783736" } ] } }, { "035" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "(DE-599)GBV101073931X" } ] } }, { "040" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "b" : "ger" }, { "c" : "GBVCP" }, { "e" : "rda" } ] } }, { "041" : { "ind1" : "0", "ind2" : " ", "subfields" : [ { "a" : "eng" } ] } }, { "245" : { "ind1" : "0", "ind2" : "0", "subfields" : [ { "a" : "Futures, biometrics and neuroscience research" }, { "c" : "Luiz Moutinho, Mladen Sokele, editors" } ] } }, { "264" : { "ind1" : "3", "ind2" : "1", "subfields" : [ { "a" : "Cham" }, { "b" : "Palgrave Macmillan" }, { "c" : "[2018]" } ] } }, { "300" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "xxix, 224 Seiten" }, { "b" : "Illustrationen" } ] } }, { "336" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "Text" }, { "b" : "txt" }, { "2" : "rdacontent" } ] } }, { "337" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "ohne Hilfsmittel zu benutzen" }, { "b" : "n" }, { "2" : "rdamedia" } ] } }, { "338" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "Band" }, { "b" : "nc" }, { "2" : "rdacarrier" } ] } }, { "490" : { "ind1" : "0", "ind2" : " ", "subfields" : [ { "a" : "Innovative research methodologies in management" }, { "v" : " / Luiz Moutinho, Mladen Sokele ; Volume 2" } ] } }, { "500" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "Enthält 9 Beiträge" } ] } }, { "650" : { "ind1" : " ", "ind2" : "7", "subfields" : [ { "8" : "1.1 x" }, { "a" : "Betriebswirtschaftslehre" }, { "0" : "(DE-601)091351391" }, { "0" : "(DE-STW)12041-5" }, { "2" : "stw" } ] } }, { "650" : { "ind1" : " ", "ind2" : "7", "subfields" : [ { "8" : "1.2 x" }, { "a" : "Management" }, { "0" : "(DE-601)091376173" }, { "0" : "(DE-STW)12085-6" }, { "2" : "stw" } ] } }, { "650" : { "ind1" : " ", "ind2" : "7", "subfields" : [ { "8" : "1.3 x" }, { "a" : "Wissenschaftliche Methode" }, { "0" : "(DE-601)091401445" }, { "0" : "(DE-STW)16727-0" }, { "2" : "stw" } ] } }, { "700" : { "ind1" : "1", "ind2" : " ", "subfields" : [ { "a" : "Moutinho, Luiz" }, { "e" : "HerausgeberIn" }, { "4" : "edt" }, { "0" : "(DE-601)509450954" }, { "0" : "(DE-588)131450204" } ] } }, { "700" : { "ind1" : "1", "ind2" : " ", "subfields" : [ { "a" : "Sokele, Mladen" }, { "e" : "HerausgeberIn" }, { "4" : "edt" } ] } }, { "830" : { "ind1" : " ", "ind2" : "0", "subfields" : [ { "a" : "Innovative research methodologies in management" }, { "b" : " / Luiz Moutinho, Mladen Sokele" }, { "v" : "Volume 2" }, { "9" : "2.2018" }, { "w" : "(DE-601)1011380293" } ] } }, { "856" : { "ind1" : "4", "ind2" : "2", "subfields" : [ { "y" : "Inhaltsverzeichnis" }, { "u" : "http://www.gbv.de/dms/zbw/101073931X.pdf" }, { "m" : "V:DE-601;B:DE-206" }, { "q" : "application/pdf" }, { "3" : "Inhaltsverzeichnis" } ] } }, { "900" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "a" : "GBV" }, { "b" : "ZBW Kiel <206>" }, { "d" : "!H:! A18-1775" }, { "x" : "L" }, { "z" : "LC" }, { "s" : "206/1" } ] } }, { "954" : { "ind1" : " ", "ind2" : " ", "subfields" : [ { "0" : "ZBW Kiel <206>" }, { "a" : "26" }, { "b" : "1740761685" }, { "c" : "01" }, { "f" : "H:" }, { "d" : "A18-1775" }, { "e" : "u" }, { "x" : "206/1" } ] } } ] } }, "deleted" : false, "externalIdsHolder" : { "instanceId" : "24db5e55-478e-4da1-85b5-3e4ab41987eb" }, "additionalInfo" : { "suppressDiscovery" : false }, "metadata" : { "createdDate" : "2020-04-01T18:08:33.175+0000", "createdByUserId" : "3e13b2e5-f7bf-51a7-877d-e7b876d29617", "updatedDate" : "2020-04-01T18:08:33.175+0000", "updatedByUserId" : "3e13b2e5-f7bf-51a7-877d-e7b876d29617" } }

4) Retrieve record with quickMARC

curl 'https://folio-testing-okapi.aws.indexdata.com/records-editor/records?instanceId=24db5e55-478e-4da1-85b5-3e4ab41987eb' -H "X-Okapi-Token: $TOKEN" -w'\n' { "parsedRecordId" : "4da43ec0-898a-40a0-a47f-fdf7c5aa41f6", "externalDtoId" : "53cb4459-90e9-46ef-afab-ca202c30ed04", "leader" : "01741nam a2200373 cb4500", "fields" : [ { "tag" : "001", "content" : "101073931X", "indicators" : [ ] }, { "tag" : "003", "content" : "DE-601", "indicators" : [ ] }, { "tag" : "005", "content" : "20180416162657.0", "indicators" : [ ] }, { "tag" : "008", "content" : { "Content" : "Books", "Type" : "a", "BLvl" : "m", "Entered" : "180111", "DtSt" : "s", "Date1" : "2018", "Date2" : " ", "Ctry" : "sz ", "Ills" : [ " ", " ", " ", " " ], "Audn" : " ", "Form" : " ", "Cont" : [ " ", " ", " ", " " ], "GPub" : " ", "Conf" : "0", "Fest" : "0", "Indx" : "0", "LitF" : "0", "Biog" : " ", "Lang" : "eng", "MRec" : " ", "Srce" : "d" }, "indicators" : [ ] }, { "tag" : "020", "content" : "$a 3319643991 $9 3-319-64399-1", "indicators" : [ " ", " " ] }, { "tag" : "020", "content" : "$a 9783319643991 $9 978-3-319-64399-1", "indicators" : [ " ", " " ] }, { "tag" : "020", "content" : "$a 9783319644004 (electronic) $9 978-3-319-64400-4", "indicators" : [ " ", " " ] }, { "tag" : "035", "content" : "$a (OCoLC)ocn992783736", "indicators" : [ " ", " " ] }, { "tag" : "035", "content" : "$a (OCoLC)992783736", "indicators" : [ " ", " " ] }, { "tag" : "035", "content" : "$a (DE-599)GBV101073931X", "indicators" : [ " ", " " ] }, { "tag" : "040", "content" : "$b ger $c GBVCP $e rda", "indicators" : [ " ", " " ] }, { "tag" : "041", "content" : "$a eng", "indicators" : [ "0", " " ] }, { "tag" : "245", "content" : "$a Futures, biometrics and neuroscience research $c Luiz Moutinho, Mladen Sokele, editors", "indicators" : [ "0", "0" ] }, { "tag" : "264", "content" : "$a Cham $b Palgrave Macmillan $c [2018]", "indicators" : [ "3", "1" ] }, { "tag" : "300", "content" : "$a xxix, 224 Seiten $b Illustrationen", "indicators" : [ " ", " " ] }, { "tag" : "336", "content" : "$a Text $b txt $2 rdacontent", "indicators" : [ " ", " " ] }, { "tag" : "337", "content" : "$a ohne Hilfsmittel zu benutzen $b n $2 rdamedia", "indicators" : [ " ", " " ] }, { "tag" : "338", "content" : "$a Band $b nc $2 rdacarrier", "indicators" : [ " ", " " ] }, { "tag" : "490", "content" : "$a Innovative research methodologies in management $v / Luiz Moutinho, Mladen Sokele ; Volume 2", "indicators" : [ "0", " " ] }, { "tag" : "500", "content" : "$a Enthält 9 Beiträge", "indicators" : [ " ", " " ] }, { "tag" : "650", "content" : "$8 1.1 x $a Betriebswirtschaftslehre $0 (DE-601)091351391 $0 (DE-STW)12041-5 $2 stw", "indicators" : [ " ", "7" ] }, { "tag" : "650", "content" : "$8 1.2 x $a Management $0 (DE-601)091376173 $0 (DE-STW)12085-6 $2 stw", "indicators" : [ " ", "7" ] }, { "tag" : "650", "content" : "$8 1.3 x $a Wissenschaftliche Methode $0 (DE-601)091401445 $0 (DE-STW)16727-0 $2 stw", "indicators" : [ " ", "7" ] }, { "tag" : "700", "content" : "$a Moutinho, Luiz $e HerausgeberIn $4 edt $0 (DE-601)509450954 $0 (DE-588)131450204", "indicators" : [ "1", " " ] }, { "tag" : "700", "content" : "$a Sokele, Mladen $e HerausgeberIn $4 edt", "indicators" : [ "1", " " ] }, { "tag" : "830", "content" : "$a Innovative research methodologies in management $b / Luiz Moutinho, Mladen Sokele $v Volume 2 $9 2.2018 $w (DE-601)1011380293", "indicators" : [ " ", "0" ] }, { "tag" : "856", "content" : "$y Inhaltsverzeichnis $u http://www.gbv.de/dms/zbw/101073931X.pdf $m V:DE-601;B:DE-206 $q application/pdf $3 Inhaltsverzeichnis", "indicators" : [ "4", "2" ] }, { "tag" : "900", "content" : "$a GBV $b ZBW Kiel <206> $d !H:! A18-1775 $x L $z LC $s 206/1", "indicators" : [ " ", " " ] }, { "tag" : "954", "content" : "$0 ZBW Kiel <206> $a 26 $b 1740761685 $c 01 $f H: $d A18-1775 $e u $x 206/1", "indicators" : [ " ", " " ] } ] }

5) Verify quickMARC NOT_FOUND:

curl 'https://folio-testing-okapi.aws.indexdata.com/records-editor/records?instanceId=24db5e55-478e-4da1-85b5-3e4ab41987ea' -H "X-Okapi-Token: $TOKEN" -w'\n' { "message" : "Record with id=24db5e55-478e-4da1-85b5-3e4ab41987ea not found", "type" : "-1", "code" : "HTTP_NOT_FOUND", "parameters" : [ { "key" : "instanceId", "value" : "24db5e55-478e-4da1-85b5-3e4ab41987ea" } ] }

6) Verify quickMARC BAD_REQUEST:

curl $OKAPI/records-editor/records -H "X-Okapi-Token: $TOKEN" -w'\n' { "message" : "instanceId parameter is not presented", "type" : "-2", "code" : "HTTP_BAD_REQUEST", "parameters" : [ ] }

7) Verify quickMARC UUID bad format:

curl 'https://folio-testing-okapi.aws.indexdata.com/records-editor/records?instanceId=24db5e55-478e-4da1-85b5' -H "X-Okapi-Token: $TOKEN" -w'\n' 'instanceId' parameter is incorrect. parameter value {24db5e55-478e-4da1-85b5} is not valid: must match "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
Done

Details

Assignee

Reporter

Tester Assignee

Priority

Story Points

Sprint

Development Team

Firebird

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created March 8, 2020 at 10:09 AM
Updated April 2, 2020 at 11:24 AM
Resolved April 2, 2020 at 11:24 AM
TestRail: Cases
TestRail: Runs