summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fatcat-openapi2.yml12
-rw-r--r--rust/migrations/2018-05-12-001226_init/up.sql58
-rw-r--r--rust/tests/test_api_server.rs28
3 files changed, 49 insertions, 49 deletions
diff --git a/fatcat-openapi2.yml b/fatcat-openapi2.yml
index 8ced937d..a981cc44 100644
--- a/fatcat-openapi2.yml
+++ b/fatcat-openapi2.yml
@@ -22,7 +22,7 @@ x-entity-props: &ENTITYPROPS
ident:
type: string
#format: uuid
- example: "f1f046a3-45c9-4b99-adce-000000000001"
+ example: "00000000-0000-0000-adce-000000000001"
revision:
type: integer
example: 42
@@ -30,7 +30,7 @@ x-entity-props: &ENTITYPROPS
redirect:
type: string
#format: uuid
- example: "f1f046a3-45c9-4b99-adce-000000000002"
+ example: "00000000-0000-0000-adce-000000000002"
editgroup_id:
type: integer
example: 16
@@ -126,10 +126,10 @@ definitions:
type: string
work_id:
type: string
- example: "f1f046a3-45c9-4b99-adce-000000000001"
+ example: "00000000-0000-0000-adce-000000000001"
container_id:
type: string
- example: "f1f046a3-45c9-4b99-adce-000000000001"
+ example: "00000000-0000-0000-adce-000000000001"
release_type:
type: string
example: "preprint"
@@ -179,14 +179,14 @@ definitions:
format: int64
ident:
type: string
- example: "f1f046a3-45c9-4b99-adce-000000000001"
+ example: "00000000-0000-0000-adce-000000000001"
revision:
type: integer
example: 42
format: int64
redirect_ident:
type: string
- example: "f1f046a3-45c9-4b99-adce-000000000002"
+ example: "00000000-0000-0000-adce-000000000002"
#format: uuid
editgroup_id:
type: integer
diff --git a/rust/migrations/2018-05-12-001226_init/up.sql b/rust/migrations/2018-05-12-001226_init/up.sql
index 474029d0..2bd6714a 100644
--- a/rust/migrations/2018-05-12-001226_init/up.sql
+++ b/rust/migrations/2018-05-12-001226_init/up.sql
@@ -249,12 +249,12 @@ INSERT INTO container_rev (name, issnl, abbrev, coden) VALUES
('MySpace Blog', null, null, null);
INSERT INTO container_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-cccc-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-cccc-000000000002', true, 2, null);
+ ('00000000-0000-0000-1111-000000000001', true, 1, null),
+ ('00000000-0000-0000-1111-000000000002', true, 2, null);
INSERT INTO container_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-cccc-000000000001', 1, null, 4),
- ('f1f046a3-45c9-4b99-cccc-000000000002', 2, null, 5);
+ ('00000000-0000-0000-1111-000000000001', 1, null, 4),
+ ('00000000-0000-0000-1111-000000000002', 2, null, 5);
INSERT INTO creator_rev (full_name, orcid) VALUES
('Grace Hopper', null),
@@ -262,62 +262,62 @@ INSERT INTO creator_rev (full_name, orcid) VALUES
('Christine Moran', '0000-0003-2088-7465');
INSERT INTO creator_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-adce-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-adce-000000000002', true, 2, null),
- ('f1f046a3-45c9-4b99-adce-000000000003', true, 3, null),
- ('f1f046a3-45c9-4b99-adce-000000000004', false, 2, null);
+ ('00000000-0000-0000-2222-000000000001', true, 1, null),
+ ('00000000-0000-0000-2222-000000000002', true, 2, null),
+ ('00000000-0000-0000-2222-000000000003', true, 3, null),
+ ('00000000-0000-0000-2222-000000000004', false, 2, null);
INSERT INTO creator_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-adce-000000000001', 1, null, 1),
- ('f1f046a3-45c9-4b99-adce-000000000002', 2, null, 2),
- ('f1f046a3-45c9-4b99-adce-000000000003', 3, null, 3),
- ('f1f046a3-45c9-4b99-adce-000000000004', 2, null, 4);
+ ('00000000-0000-0000-2222-000000000001', 1, null, 1),
+ ('00000000-0000-0000-2222-000000000002', 2, null, 2),
+ ('00000000-0000-0000-2222-000000000003', 3, null, 3),
+ ('00000000-0000-0000-2222-000000000004', 2, null, 4);
INSERT INTO file_rev (size, sha1, md5, url) VALUES
(null, null, null, null),
(4321, '7d97e98f8af710c7e7fe703abc8f639e0ee507c4', null, 'http://archive.org/robots.txt');
INSERT INTO file_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-ffff-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-ffff-000000000002', true, 2, null);
+ ('00000000-0000-0000-3333-000000000001', true, 1, null),
+ ('00000000-0000-0000-3333-000000000002', true, 2, null);
INSERT INTO file_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-ffff-000000000001', 1, null, 4),
- ('f1f046a3-45c9-4b99-ffff-000000000002', 2, null, 5);
+ ('00000000-0000-0000-3333-000000000001', 1, null, 4),
+ ('00000000-0000-0000-3333-000000000002', 2, null, 5);
INSERT INTO work_rev (work_type, primary_release_id) VALUES
(null, null),
('journal-article', null);
INSERT INTO work_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-3333-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-3333-000000000002', true, 2, null);
+ ('00000000-0000-0000-5555-000000000001', true, 1, null),
+ ('00000000-0000-0000-5555-000000000002', true, 2, null);
INSERT INTO work_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-3333-000000000001', 1, null, 4),
- ('f1f046a3-45c9-4b99-3333-000000000002', 2, null, 5);
+ ('00000000-0000-0000-5555-000000000001', 1, null, 4),
+ ('00000000-0000-0000-5555-000000000002', 2, null, 5);
INSERT INTO release_rev (work_ident_id, container_ident_id, title, release_type, date, doi, isbn13, volume, pages, issue, publisher) VALUES
- ('f1f046a3-45c9-4b99-3333-000000000001', null, 'example title', null, null, null, null, null, null, null, null),
- ('f1f046a3-45c9-4b99-3333-000000000002', 'f1f046a3-45c9-4b99-cccc-000000000001', 'bigger example', 'journal-article', '2018-01-01', null, '10.123/abc', '12', '5-9', 'IV', null);
+ ('00000000-0000-0000-5555-000000000001', null, 'example title', null, null, null, null, null, null, null, null),
+ ('00000000-0000-0000-5555-000000000002', '00000000-0000-0000-1111-000000000001', 'bigger example', 'journal-article', '2018-01-01', null, '10.123/abc', '12', '5-9', 'IV', null);
INSERT INTO release_ident (id, is_live, rev_id, redirect_id) VALUES
- ('f1f046a3-45c9-4b99-4444-000000000001', true, 1, null),
- ('f1f046a3-45c9-4b99-4444-000000000002', true, 2, null);
+ ('00000000-0000-0000-4444-000000000001', true, 1, null),
+ ('00000000-0000-0000-4444-000000000002', true, 2, null);
INSERT INTO release_edit (ident_id, rev_id, redirect_id, editgroup_id) VALUES
- ('f1f046a3-45c9-4b99-4444-000000000001', 1, null, 4),
- ('f1f046a3-45c9-4b99-4444-000000000002', 2, null, 5);
+ ('00000000-0000-0000-4444-000000000001', 1, null, 4),
+ ('00000000-0000-0000-4444-000000000002', 2, null, 5);
INSERT INTO release_contrib (release_rev, creator_ident_id, stub, role, index) VALUES
(2, null, null, null, null),
- (2, 'f1f046a3-45c9-4b99-adce-000000000002', 'some contrib', 'editor', 4);
+ (2, '00000000-0000-0000-2222-000000000002', 'some contrib', 'editor', 4);
INSERT INTO release_ref (release_rev, target_release_ident_id, index, stub) VALUES
(2, null, null, null),
- (2, 'f1f046a3-45c9-4b99-4444-000000000001', 4, 'citation note');
+ (2, '00000000-0000-0000-4444-000000000001', 4, 'citation note');
INSERT INTO file_release (file_rev, target_release_ident_id) VALUES
- (2, 'f1f046a3-45c9-4b99-4444-000000000002');
+ (2, '00000000-0000-0000-4444-000000000002');
COMMIT;
diff --git a/rust/tests/test_api_server.rs b/rust/tests/test_api_server.rs
index c5a5a60c..36605661 100644
--- a/rust/tests/test_api_server.rs
+++ b/rust/tests/test_api_server.rs
@@ -47,7 +47,7 @@ fn test_entity_gets() {
check_response(
request::get(
- "http://localhost:9411/v0/container/f1f046a3-45c9-4b99-cccc-000000000002",
+ "http://localhost:9411/v0/container/00000000-0000-0000-1111-000000000002",
headers.clone(),
&router,
),
@@ -57,7 +57,7 @@ fn test_entity_gets() {
check_response(
request::get(
- "http://localhost:9411/v0/creator/f1f046a3-45c9-4b99-adce-000000000001",
+ "http://localhost:9411/v0/creator/00000000-0000-0000-2222-000000000001",
headers.clone(),
&router,
),
@@ -67,7 +67,7 @@ fn test_entity_gets() {
check_response(
request::get(
- "http://localhost:9411/v0/file/f1f046a3-45c9-4b99-ffff-000000000002",
+ "http://localhost:9411/v0/file/00000000-0000-0000-3333-000000000002",
headers.clone(),
&router,
),
@@ -77,22 +77,22 @@ fn test_entity_gets() {
check_response(
request::get(
- "http://localhost:9411/v0/work/f1f046a3-45c9-4b99-3333-000000000002",
+ "http://localhost:9411/v0/release/00000000-0000-0000-4444-000000000002",
headers.clone(),
&router,
),
status::Ok,
- None,
+ Some("bigger example"),
);
check_response(
request::get(
- "http://localhost:9411/v0/release/f1f046a3-45c9-4b99-4444-000000000002",
+ "http://localhost:9411/v0/work/00000000-0000-0000-5555-000000000002",
headers.clone(),
&router,
),
status::Ok,
- Some("bigger example"),
+ None,
);
}
@@ -102,7 +102,7 @@ fn test_entity_404() {
check_response(
request::get(
- "http://localhost:9411/v0/creator/f1f046a3-45c9-4b99-adce-999999999999",
+ "http://localhost:9411/v0/creator/00000000-0000-0000-2222-999999999999",
headers.clone(),
&router,
),
@@ -217,8 +217,8 @@ fn test_post_file() {
"sha1": "f013d66c7f6817d08b7eb2a93e6d0440c1f3e7f8",
"url": "http://archive.org/asdf.txt",
"releases": [
- "f1f046a3-45c9-4b99-4444-000000000001",
- "f1f046a3-45c9-4b99-4444-000000000002"
+ "00000000-0000-0000-4444-000000000001",
+ "00000000-0000-0000-4444-000000000002"
],
"extra": { "source": "speculation" }
}"#,
@@ -240,7 +240,7 @@ fn test_post_release() {
// TODO: target_release_id
r#"{"title": "secret minimal paper",
"release_type": "journal-article",
- "work_id": "f1f046a3-45c9-4b99-3333-000000000001"
+ "work_id": "00000000-0000-0000-5555-000000000001"
}"#,
&router,
),
@@ -259,8 +259,8 @@ fn test_post_release() {
"volume": "439",
"pages": "1-399",
"issue": "IV",
- "work_id": "f1f046a3-45c9-4b99-3333-000000000002",
- "container_id": "f1f046a3-45c9-4b99-cccc-000000000001",
+ "work_id": "00000000-0000-0000-5555-000000000002",
+ "container_id": "00000000-0000-0000-1111-000000000001",
"refs": [{
"index": 3,
"stub": "just a string"
@@ -270,7 +270,7 @@ fn test_post_release() {
"contribs": [{
"index": 1,
"creator_stub": "textual description of contributor (aka, name)",
- "creator_id": "f1f046a3-45c9-4b99-adce-000000000001",
+ "creator_id": "00000000-0000-0000-2222-000000000001",
"contrib_type": "author"
},{
"creator_stub": "shorter"