Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-449
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPhura committed Oct 24, 2024
2 parents 2d86593 + bb7855b commit 667f2b8
Show file tree
Hide file tree
Showing 63 changed files with 185 additions and 15 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/custom-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Custom Linter

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches:
- dev

jobs:
# OpenAPI request bodies should contain the property `required` and be set to true
#
# // Valid (request body required)
#
# requestBody: {
# required: true,
# content: {}
# }
#
# // Invalid (request body not required)
#
# requestBody: {
# content: {}
# }
#
openApiRequiredRequestBody:
name: OpenAPI requestBody missing required:true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Find schemas with optional request bodies
run: |
# For OpenAPI schemas, find all request bodies that don't have `required:true`
#
# Find all non-test files in apr/src/paths
# Find all request bodies that don't contain required:true property
# Print to stdout line num + filename and return exit code
find api/src/paths -type f ! -name '*.test.ts' -exec \
awk '
BEGIN {found=0}
/requestBody:/ {found=1}
/required: true/ {found=0}
/content:/ {
if (found) print "line: " NR, FILENAME;
found=0;
}
' {} \; \
| grep . && exit 1 || exit 0
1 change: 1 addition & 0 deletions api/src/paths/administrative-activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Administrative Activity post request object.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
1 change: 1 addition & 0 deletions api/src/paths/funding-sources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Funding source post request object.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
1 change: 1 addition & 0 deletions api/src/paths/funding-sources/{fundingSourceId}.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ PUT.apiDoc = {
],
requestBody: {
description: 'Funding source put request object.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
1 change: 1 addition & 0 deletions api/src/paths/gcnotify/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Send notification to given recipient',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Attachment upload post request object.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
1 change: 1 addition & 0 deletions api/src/paths/project/{projectId}/attachments/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Attachment upload post request object.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Current attachment type for project attachment.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
1 change: 1 addition & 0 deletions api/src/paths/project/{projectId}/participants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ POST.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
1 change: 1 addition & 0 deletions api/src/paths/project/{projectId}/survey/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey post request object.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Attachment upload post request object.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Telemetry device credential file upload post request object.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Attachment upload post request object.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Current attachment type for survey attachment.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Critterbase Captures CSV import file.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Array of survey critter Ids to be deleted.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey critters csv file to import',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Critterbase create critter request object',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Critterbase Markings CSV import file.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Critterbase Measurements CSV import file.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Attachment upload post request object.',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Object with device information and associated captures to create a deployment',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ PATCH.apiDoc = {
],
requestBody: {
description: 'Specifies a deployment id and the new timerange to update it with.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ PATCH.apiDoc = {
],
requestBody: {
description: 'Critterbase bulk patch request object',
required: true,
content: {
'application/json': {
schema: critterBulkRequestObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Array of one or more deployment IDs to delete.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ PUT.apiDoc = {
],
requestBody: {
description: 'Specifies a deployment id and the new timerange to update it with.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Export SIMS data request object.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey observation record data',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey observation environment delete request body.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ PUT.apiDoc = {
],
requestBody: {
description: 'Survey observation record data',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey observation measurement delete request body.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Request body',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey observation submission file to upload',
required: true,
content: {
'multipart/form-data': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ POST.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ POST.apiDoc = {
],
requestBody: {
description: 'Survey sample site delete request object.',
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ POST.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ POST.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ PUT.apiDoc = {
}
],
requestBody: {
required: true,
content: {
'application/json': {
schema: {
Expand Down
Loading

0 comments on commit 667f2b8

Please sign in to comment.