Skip to content

Commit

Permalink
forbid additional properties in filtering terms
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfk committed Feb 3, 2023
1 parent 381e3ba commit 87d2531
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion framework/json/requests/filteringTerms.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"AlphanumericFilter": {
"additionalProperties": false,
"description": "Filter results based on operators and values applied to alphanumeric fields.",
"properties": {
"id": {
Expand Down Expand Up @@ -43,6 +43,7 @@
"type": "object"
},
"CustomFilter": {
"additionalProperties": false,
"description": "Filter results to include records that contain a custom term defined by this Beacon.",
"properties": {
"id": {
Expand Down Expand Up @@ -75,6 +76,7 @@
]
},
"OntologyFilter": {
"additionalProperties": false,
"description": "Filter results to include records that contain a specific ontology term.",
"properties": {
"id": {
Expand Down
4 changes: 3 additions & 1 deletion framework/src/requests/filteringTerms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ definitions:
type: string
description: The entry type to which the filter applies
example: biosamples
additionalProperties: false
AlphanumericFilter:
description: Filter results based on operators and values applied to alphanumeric
fields.
Expand Down Expand Up @@ -82,6 +83,7 @@ definitions:
type: string
description: The entry type to which the filter applies
example: biosamples
additionalProperties: false
CustomFilter:
type: object
description: Filter results to include records that contain a custom term defined
Expand All @@ -97,4 +99,4 @@ definitions:
type: string
description: The entry type to which the filter applies
example: biosamples
additionalProperties: true
additionalProperties: false

2 comments on commit 87d2531

@gsfk
Copy link
Owner Author

@gsfk gsfk commented on 87d2531 Feb 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that changing the top-level additionalProperties value to "false" has no effect.

@mbaudis
Copy link

@mbaudis mbaudis commented on 87d2531 Feb 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me like an improvement => +1 (though not solving all potential problems)

Please sign in to comment.