Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion genoatt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ HELP
run_oatt() {

rm ./test/v*.js
oatts generate --host $remote -s ./openapi.yaml -w test
oatts generate --host $remote -m $scheme -s ./openapi.yaml -w test
yarn dlx eslint --quiet --fix ./test > genoatt.log

# oatts is a bit silly in picking its variables. We need to make sure that we're
Expand Down Expand Up @@ -53,6 +53,9 @@ run_oatt() {

test=0
remote=localhost:3001
# The remote hosts 301-redirect http -> https, so generated tests must use the right
# scheme. oatts defaults to http when the flag is absent.
scheme=http

while getopts "htldpa" opt; do
case $opt in
Expand All @@ -68,12 +71,15 @@ remote=localhost:3001
;;
d)
remote=api-dev.neotomadb.org
scheme=https
;;
p)
remote=api.neotomadb.org
scheme=https
;;
a)
remote=neotomaapi-env.eba-wd29jtvf.us-east-2.elasticbeanstalk.com
scheme=https
;;
*)
echo You didn\'t use the correct flag.
Expand Down
34 changes: 34 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,8 @@ components:
type: array
geography:
$ref: '#/components/schemas/geography'
recdatecreated:
$ref: '#/components/schemas/recdatecreated'
sitedescription:
$ref: '#/components/schemas/sitedescription'
siteid:
Expand Down Expand Up @@ -3345,6 +3347,38 @@ paths:
tags:
- Lithology metadata
- v2.0
/v2.0/data/datasets/{datasetid}/assays:
get:
description: Returns the aeDNA assays (and their sequencing libraries) linked to a dataset.
parameters:
- $ref: '#/components/parameters/datasetidPath'
responses:
'200':
content:
application/json:
schema:
type: object
description: Assays
summary: aeDNA assay and library metadata for a dataset.
tags:
- Assay metadata
- v2.0
/v2.0/data/datasets/{datasetid}/projects:
get:
description: Returns the research projects (and their participants) linked to a dataset.
parameters:
- $ref: '#/components/parameters/datasetidPath'
responses:
'200':
content:
application/json:
schema:
type: object
description: Projects
Comment on lines +3350 to +3377
summary: Project and participant metadata for a dataset.
tags:
- Project metadata
- v2.0
/v2.0/data/datasets/{datasetid}/publications:
get:
description: Returns publications data associated with specific datasets.
Expand Down
2 changes: 2 additions & 0 deletions openapi/components/schemas/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,8 @@ sitesv2:
type: array
geography:
$ref: '#/components/schemas/geography'
recdatecreated:
$ref: '#/components/schemas/recdatecreated'
sitedescription:
$ref: '#/components/schemas/sitedescription'
siteid:
Expand Down
32 changes: 32 additions & 0 deletions openapi/paths/v20/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,38 @@
tags:
- Lithology metadata
- v2.0
/v2.0/data/datasets/{datasetid}/assays:
get:
description: Returns the aeDNA assays (and their sequencing libraries) linked to a dataset.
parameters:
- $ref: '#/components/parameters/datasetidPath'
responses:
'200':
content:
application/json:
schema:
type: object
description: Assays
Comment on lines +336 to +347
summary: aeDNA assay and library metadata for a dataset.
tags:
- Assay metadata
- v2.0
/v2.0/data/datasets/{datasetid}/projects:
get:
description: Returns the research projects (and their participants) linked to a dataset.
parameters:
- $ref: '#/components/parameters/datasetidPath'
responses:
'200':
content:
application/json:
schema:
type: object
description: Projects
summary: Project and participant metadata for a dataset.
tags:
- Project metadata
- v2.0
/v2.0/data/datasets/{datasetid}/publications:
get:
description: Returns publications data associated with specific datasets.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"start": "NODE_ENV=production nodemon --legacy-watch app.js",
"dev": "NODE_ENV=development nodemon --legacy-watch app.js",
"test": "node ./node_modules/mocha/bin/mocha --config=test/.mocharc.yml --reporter-options reportDir=public,reportFilename=tests",
"test": "APIPATH=${APIPATH:-http://localhost:3001/} node ./node_modules/mocha/bin/mocha --config=test/.mocharc.yml --reporter-options reportDir=public,reportFilename=tests",
"build:openapi": "(cd ./openapi && node ./scripts/build-openapi.js)",
"validate:openapi": "yarn build:openapi && bash genoatt.sh && sleep 4 && bash runmochabatch.sh"
},
Expand Down
2 changes: 1 addition & 1 deletion public/tests.html

Large diffs are not rendered by default.

Loading