Skip to content

Commit e1c90a8

Browse files
author
Pablo Panero
committed
run/config: update outputs with new data model
1 parent ce6527b commit e1c90a8

File tree

2 files changed

+350
-64
lines changed

2 files changed

+350
-64
lines changed

docs/develop/config.md

Lines changed: 134 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,74 @@ That's it configuration-wise. If we try to create a record through the API, your
3636
Did the changes work? We are going to try to create a new record:
3737

3838
``` console
39-
$ curl -k -XPOST -H "Content-Type: application/json" https://localhost:5000/api/records/ -d '
40-
{
41-
"access": {
42-
"metadata_restricted": "false",
43-
"files_restricted": "false"
39+
$ curl -k -XPOST -H "Content-Type: application/json" https://localhost:5000/api/records/ -d '{
40+
"_access": {
41+
"metadata_restricted": false,
42+
"files_restricted": false
43+
},
44+
"_owners": [1],
45+
"_created_by": 1,
46+
"access_right": "open",
47+
"resource_type": {
48+
"type": "image",
49+
"subtype": "photo"
50+
},
51+
"identifiers": [
52+
{
53+
"identifier": "10.9999/rdm.9999999",
54+
"scheme": "DOI"
55+
}, {
56+
"identifier": "9999.99999",
57+
"scheme": "arXiv"
58+
}
59+
],
60+
"creators": [
61+
{
62+
"name": "Julio Cesar",
63+
"type": "Personal",
64+
"given_name": "Julio",
65+
"family_name": "Cesar",
66+
"identifiers": [
67+
{
68+
"identifier": "9999-9999-9999-9999",
69+
"scheme": "Orcid"
70+
}
71+
],
72+
"affiliations": [
73+
{
74+
"name": "Entity One",
75+
"identifier": "entity-one",
76+
"scheme": "entity-id-scheme"
77+
}
78+
]
79+
}
80+
],
81+
"titles": [
82+
{
83+
"title": "A Romans story",
84+
"type": "Other",
85+
"lang": "eng"
86+
}
87+
],
88+
"descriptions": [
89+
{
90+
"description": "A story on how Julio Cesar relates to Gladiator.",
91+
"type": "Abstract",
92+
"lang": "eng"
93+
}
94+
],
95+
"community": {
96+
"primary": "Maincom",
97+
"secondary": ["Subcom One", "Subcom Two"]
4498
},
45-
"access_right": "open",
46-
"contributors": [{"name": "Jon Doe"}],
47-
"description": "A Holiday Record description",
48-
"owners": [1],
49-
"publication_date": "25/12/2019",
50-
"resource_type": {
51-
"type": "Dataset",
52-
"subtype": "dataset"
53-
},
54-
"title": "A Holiday Record"
99+
"licenses": [
100+
{
101+
"license": "Berkeley Software Distribution 3",
102+
"uri": "https://opensource.org/licenses/BSD-3-Clause",
103+
"identifier": "BSD-3",
104+
"scheme": "BSD-3"
105+
}
106+
]
55107
}'
56108
```
57109

@@ -88,22 +140,74 @@ Note that this user will have ID 2.
88140
Afterwards we can test if the new permissions are working correctly.
89141

90142
``` console
91-
$ curl -k -XPOST -H "Authorization:Bearer sHHq1K9y7a2v5doKDRSFmSFOxa1tZDHFcbs31npaxm1sFEt27yomLMt0ynkl" -H "Content-Type: application/json" https://localhost:5000/api/records/ -d '
92-
{
93-
"access": {
94-
"metadata_restricted": "false",
95-
"files_restricted": "false"
96-
},
97-
"access_right": "open",
98-
"contributors": [{"name": "Jon Doe"}],
99-
"description": "A Holiday Record description",
100-
"owners": [1],
101-
"publication_date": "25/12/2019",
102-
"resource_type": {
103-
"type": "Dataset",
104-
"subtype": "dataset"
143+
$ curl -k -XPOST -H "Authorization:Bearer sHHq1K9y7a2v5doKDRSFmSFOxa1tZDHFcbs31npaxm1sFEt27yomLMt0ynkl" -H "Content-Type: application/json" https://localhost:5000/api/records/ -d '{
144+
"_access": {
145+
"metadata_restricted": false,
146+
"files_restricted": false
147+
},
148+
"_owners": [1],
149+
"_created_by": 1,
150+
"access_right": "open",
151+
"resource_type": {
152+
"type": "image",
153+
"subtype": "photo"
154+
},
155+
"identifiers": [
156+
{
157+
"identifier": "10.9999/rdm.9999999",
158+
"scheme": "DOI"
159+
}, {
160+
"identifier": "9999.99999",
161+
"scheme": "arXiv"
162+
}
163+
],
164+
"creators": [
165+
{
166+
"name": "Julio Cesar",
167+
"type": "Personal",
168+
"given_name": "Julio",
169+
"family_name": "Cesar",
170+
"identifiers": [
171+
{
172+
"identifier": "9999-9999-9999-9999",
173+
"scheme": "Orcid"
174+
}
175+
],
176+
"affiliations": [
177+
{
178+
"name": "Entity One",
179+
"identifier": "entity-one",
180+
"scheme": "entity-id-scheme"
181+
}
182+
]
183+
}
184+
],
185+
"titles": [
186+
{
187+
"title": "A Romans story",
188+
"type": "Other",
189+
"lang": "eng"
190+
}
191+
],
192+
"descriptions": [
193+
{
194+
"description": "A story on how Julio Cesar relates to Gladiator.",
195+
"type": "Abstract",
196+
"lang": "eng"
197+
}
198+
],
199+
"community": {
200+
"primary": "Maincom",
201+
"secondary": ["Subcom One", "Subcom Two"]
105202
},
106-
"title": "A Holiday Record"
203+
"licenses": [
204+
{
205+
"license": "Berkeley Software Distribution 3",
206+
"uri": "https://opensource.org/licenses/BSD-3-Clause",
207+
"identifier": "BSD-3",
208+
"scheme": "BSD-3"
209+
}
210+
]
107211
}'
108212
```
109213

0 commit comments

Comments
 (0)