Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating "definitions" to "$defs" #175

Merged
merged 1 commit into from
Nov 8, 2024
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
4 changes: 2 additions & 2 deletions bin/_jsonref2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# "$comment": "version: ga4gh-beacon-cohort-v2.0.0",
# "$schema": "https://json-schema.org/draft/2020-12/schema",
# "additionalProperties": true,
# "definitions": {
# "$defs": {
# "CohortCriteria": {
# "description": "THIS IS NOT OK",
# "properties": {
Expand All @@ -30,7 +30,7 @@
# "inclusionCriteria": {
# "description": "THIS IS OK",
# "type": "object",
# "$ref": "#/definitions/CohortCriteria"
# "$ref": "#/$defs/CohortCriteria"
# }
# }
# }
Expand Down
18 changes: 9 additions & 9 deletions bin/adhoc/beaconCommonComponents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {
"$defs": {
"$schema": {
"$comment": "TO REVIEW: adding a `format` or `regex` attribute that validates correctly against a file path (relative).",
"description": "Refers to the JSON Schema which describes the set of valid attributes for this particular document type. This attribute is mostly used in schemas that should be tested in Beacon implementations.",
Expand Down Expand Up @@ -83,7 +83,7 @@
"description": "A handover is a typed link for attaching actionable links to results, non purely informational, requests. The goal of the handovers is to list the different actions available, e.g.:\n* a link to a request access page * linking to a file for download, e.g. a VCF file\nAnother common scenario is to provide a fast summary response (e.g. BeconCountResponse) and to provide access to different endpoints for the entities matched by the query using temporary access tokens in the handover URLs.",
"properties": {
"handoverType": {
"$ref": "#/definitions/HandoverType"
"$ref": "#/$defs/HandoverType"
},
"note": {
"description": "An optional text including considerations on the handover link provided.",
Expand Down Expand Up @@ -148,15 +148,15 @@
"ListOfHandovers": {
"description": "Set of handovers to be added in one section the response.",
"items": {
"$ref": "#/definitions/Handover",
"$ref": "#/$defs/Handover",
"description": "Requested schema to be used for individuals in the response."
},
"type": "array"
},
"ListOfSchemas": {
"description": "Set of schemas to be used in the response to a request.",
"items": {
"$ref": "#/definitions/SchemasPerEntity"
"$ref": "#/$defs/SchemasPerEntity"
},
"type": "array"
},
Expand All @@ -182,22 +182,22 @@
"description": "Pagination to apply or that has been applied on the results.",
"properties": {
"currentPage": {
"$ref": "#/definitions/PageToken",
"$ref": "#/$defs/PageToken",
"description": "Token of the returned page. To be used only in the response to allow the client to check if the returned page is the one requested."
},
"limit": {
"$ref": "#/definitions/Limit"
"$ref": "#/$defs/Limit"
},
"nextPage": {
"$ref": "#/definitions/PageToken",
"$ref": "#/$defs/PageToken",
"description": "Token of the next page. Used to navigate forward. If empty, it is assumed that no more pages are available"
},
"previousPage": {
"$ref": "#/definitions/PageToken",
"$ref": "#/$defs/PageToken",
"description": "Token of the previous page. Used to navigate backwards. If empty, it is assumed that the current page is the first one."
},
"skip": {
"$ref": "#/definitions/Skip"
"$ref": "#/$defs/Skip"
}
},
"type": "object"
Expand Down
2 changes: 1 addition & 1 deletion bin/adhoc/ontologyTerm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"additionalProperties": true,
"properties": {
"id": {
"$ref": "./beaconCommonComponents.json#/definitions/CURIE"
"$ref": "./beaconCommonComponents.json#/$defs/CURIE"
},
"label": {
"description": "The text that describes the term. By default it could be the preferred text of the term, but is it acceptable to customize it for a clearer description and understanding of the term in an specific context.",
Expand Down
4 changes: 2 additions & 2 deletions bin/beacon_yaml2md.pl
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ sub add_properties_vrs {
my ( $property, $data ) = @_;
my %url = (
'SequenceExpression' =>
'https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/definitions/',
'https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/$defs/',
'CopyNumber' =>
'https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/definitions/'
'https://raw.githubusercontent.com/ga4gh/vrs/1.2/schema/vrs.json#/$defs/'
);
if ( exists $url{$property} ) {
$data->{properties} =
Expand Down
4 changes: 2 additions & 2 deletions bin/deref_schemas/biosamples/defaultSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
},
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {
"$defs": {
"TypedQuantity": {
"properties": {
"quantity": {
Expand Down Expand Up @@ -1479,7 +1479,7 @@
"description": "List of phenotypic abnormalities of the sample. RECOMMENDED.",
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {},
"$defs": {},
"description": "Used to describe a phenotype that characterizes the subject or biosample.",
"properties": {
"evidence": {
Expand Down
8 changes: 4 additions & 4 deletions bin/deref_schemas/cohorts/defaultSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$comment": "version: ga4gh-beacon-cohort-v2.0.0",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"CohortCriteria": {
"description": "Criteria used for defining the cohort. It is assumed that all cohort participants will match or NOT match such criteria.",
"properties": {
Expand Down Expand Up @@ -525,7 +525,7 @@
"description": "Phenotypic condition(s) in cohort inclusion criteria",
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {},
"$defs": {},
"description": "Used to describe a phenotype that characterizes the subject or biosample.",
"properties": {
"evidence": {
Expand Down Expand Up @@ -2369,7 +2369,7 @@
"description": "Phenotypic condition(s) in cohort inclusion criteria",
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {},
"$defs": {},
"description": "Used to describe a phenotype that characterizes the subject or biosample.",
"properties": {
"evidence": {
Expand Down Expand Up @@ -3418,7 +3418,7 @@
"description": "Phenotypic condition(s) in cohort inclusion criteria",
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {},
"$defs": {},
"description": "Used to describe a phenotype that characterizes the subject or biosample.",
"properties": {
"evidence": {
Expand Down
2 changes: 1 addition & 1 deletion bin/deref_schemas/datasets/defaultSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"description": "Data use conditions applying to this dataset.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"DUODataUse": {
"allOf": [
{
Expand Down
2 changes: 1 addition & 1 deletion bin/deref_schemas/genomicVariations/defaultSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$comment": "version: ga4gh-beacon-variant-v2.0.0",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"CaseLevelVariant": {
"description": "",
"properties": {
Expand Down
6 changes: 3 additions & 3 deletions bin/deref_schemas/individuals/defaultSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@
},
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {
"$defs": {
"TypedQuantity": {
"properties": {
"quantity": {
Expand Down Expand Up @@ -1812,7 +1812,7 @@
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"pedigreeMember": {
"examples": [
{
Expand Down Expand Up @@ -2401,7 +2401,7 @@
"phenotypicFeatures": {
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {},
"$defs": {},
"description": "Used to describe a phenotype that characterizes the subject or biosample.",
"properties": {
"evidence": {
Expand Down
2 changes: 1 addition & 1 deletion bin/transform_json2md.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Fixing errors in JSON
EOT

# For mysteriorous reasons ontologyTerm.json (within CURIE) only works (jsonref2json.js) with $ref: url
sed -i "s#\./beaconCommonComponents.json\#/definitions/CURIE#$adhoc_url/beaconCommonComponents.json\#/definitions/CURIE#" $fwk_dir/common/ontologyTerm.json
sed -i "s#\./beaconCommonComponents.json\#/$defs/CURIE#$adhoc_url/beaconCommonComponents.json\#/$defs/CURIE#" $fwk_dir/common/ontologyTerm.json

cat<<EOT
====================================
Expand Down
18 changes: 9 additions & 9 deletions framework/json/common/beaconCommonComponents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"definitions": {
"$defs": {
"$schema": {
"$comment": "TO REVIEW: adding a `format` or `regex` attribute that validates correctly against a file path (relative).",
"description": "Refers to the JSON Schema which describes the set of valid attributes for this particular document type. This attribute is mostly used in schemas that should be tested in Beacon implementations.",
Expand Down Expand Up @@ -88,7 +88,7 @@
"description": "A handover is a typed link for attaching actionable links to results, non purely informational, requests. The goal of the handovers is to list the different actions available, e.g.:\n* a link to a request access page * linking to a file for download, e.g. a VCF file\nAnother common scenario is to provide a fast summary response (e.g. BeconCountResponse) and to provide access to different endpoints for the entities matched by the query using temporary access tokens in the handover URLs.",
"properties": {
"handoverType": {
"$ref": "#/definitions/HandoverType"
"$ref": "#/$defs/HandoverType"
},
"note": {
"description": "An optional text including considerations on the handover link provided.",
Expand Down Expand Up @@ -157,15 +157,15 @@
"ListOfHandovers": {
"description": "Set of handovers to be added in one section the response.",
"items": {
"$ref": "#/definitions/Handover",
"$ref": "#/$defs/Handover",
"description": "Requested schema to be used for individuals in the response."
},
"type": "array"
},
"ListOfSchemas": {
"description": "Set of schemas to be used in the response to a request.",
"items": {
"$ref": "#/definitions/SchemasPerEntity"
"$ref": "#/$defs/SchemasPerEntity"
},
"type": "array"
},
Expand All @@ -191,22 +191,22 @@
"description": "Pagination to apply or that has been applied on the results.",
"properties": {
"currentPage": {
"$ref": "#/definitions/PageToken",
"$ref": "#/$defs/PageToken",
"description": "Token of the returned page. To be used only in the response to allow the client to check if the returned page is the one requested."
},
"limit": {
"$ref": "#/definitions/Limit"
"$ref": "#/$defs/Limit"
},
"nextPage": {
"$ref": "#/definitions/PageToken",
"$ref": "#/$defs/PageToken",
"description": "Token of the next page. Used to navigate forward. If empty, it is assumed that no more pages are available"
},
"previousPage": {
"$ref": "#/definitions/PageToken",
"$ref": "#/$defs/PageToken",
"description": "Token of the previous page. Used to navigate backwards. If empty, it is assumed that the current page is the first one."
},
"skip": {
"$ref": "#/definitions/Skip"
"$ref": "#/$defs/Skip"
}
},
"type": "object"
Expand Down
2 changes: 1 addition & 1 deletion framework/json/common/ontologyTerm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Definition of an ontology term.",
"properties": {
"id": {
"$ref": "./beaconCommonComponents.json#/definitions/CURIE"
"$ref": "./beaconCommonComponents.json#/$defs/CURIE"
},
"label": {
"description": "The text that describes the term. By default it could be the preferred text of the term, but is it acceptable to customize it for a clearer description and understanding of the term in an specific context.",
Expand Down
8 changes: 4 additions & 4 deletions framework/json/configuration/beaconConfigurationSchema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"EntryTypes": {
"additionalProperties": {
"$ref": "./entryTypeDefinition.json",
Expand All @@ -15,10 +15,10 @@
"description": "Files complaint with this schema are the configuration ones. The details returned in `service-info` are mirroring the ones in this configuration file.",
"properties": {
"$schema": {
"$ref": "../common/beaconCommonComponents.json#/definitions/$schema"
"$ref": "../common/beaconCommonComponents.json#/$defs/$schema"
},
"entryTypes": {
"$ref": "#/definitions/EntryTypes"
"$ref": "#/$defs/EntryTypes"
},
"maturityAttributes": {
"description": "Declares the level of maturity of the Beacon instance.",
Expand All @@ -39,7 +39,7 @@
"description": "Configuration of the security aspects of the Beacon. By default, a Beacon that does not declare the configuration settings would return `boolean` (true/false) responses, and only if the user is authenticated and explicitly authorized to access the Beacon resources. Although this is the safest set of settings, it is not recommended unless the Beacon shares very sensitive information. Non sensitive Beacons should preferably opt for a `record` and `PUBLIC` combination.",
"properties": {
"defaultGranularity": {
"$ref": "../common/beaconCommonComponents.json#/definitions/Granularity",
"$ref": "../common/beaconCommonComponents.json#/$defs/Granularity",
"description": "Default granularity. Some responses could return higher detail, but this would be the granularity by default."
},
"securityLevels": {
Expand Down
8 changes: 4 additions & 4 deletions framework/json/configuration/beaconMapSchema.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"Endpoint": {
"properties": {
"endpoints": {
"additionalProperties": {
"$ref": "#/definitions/RelatedEndpoint"
"$ref": "#/$defs/RelatedEndpoint"
},
"description": "Optional. A list describing additional endpoints implemented by this Beacon instance for that entry type. Additional details on the endpoint parameters, supported HTTP verbs, etc. could be obtained by parsing the OpenAPI definition referenced in the `openAPIEndpointsDefinition` attribute.",
"minProperties": 0,
Expand Down Expand Up @@ -64,11 +64,11 @@
"description": "Map of a Beacon, its entry types and endpoints. It isconceptually similar to a website sitemap.",
"properties": {
"$schema": {
"$ref": "../common/beaconCommonComponents.json#/definitions/$schema"
"$ref": "../common/beaconCommonComponents.json#/$defs/$schema"
},
"endpointSets": {
"additionalProperties": {
"$ref": "#/definitions/Endpoint"
"$ref": "#/$defs/Endpoint"
},
"description": "List of enpoints included in this Beacon instance. This is list is meant to inform Beacon clients, e.g. a Beacon Network, about the available endpoints, it is not used to generate any automatic list, but could be used for Beacon validation purposes.",
"minProperties": 1,
Expand Down
4 changes: 2 additions & 2 deletions framework/json/configuration/entryTypeDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Definition of an element or scope of the element, to describe each type of entry type included in a beacon. The `id` attribute is the key that should be used in other parts of the data model to allow Beacon clients to identify the different parts (e.g. endpoints, filtering terms, request parameters, etc.) that are relvant for an entry type.",
"properties": {
"$schema": {
"$ref": "../common/beaconCommonComponents.json#/definitions/$schema"
"$ref": "../common/beaconCommonComponents.json#/$defs/$schema"
},
"aCollectionOf": {
"description": "If the entry type is a collection of other entities, (e.g. a Dataset is a collection of Records), then this attribute must list the entities that can be included. One _collection_ can include more than one entry type (e.g. a Dataset in teh Beacon cdefault model could include Individuals, Biosamples, GenomicVariations, Analyses amnd Runs). In such cases in each individual response (e.g. `resultSetsResponse` of collections of type \"dataset\") will contain entries of a single entry type (e.g. biosamples) even if a dataset may contain records of multiple types.",
Expand Down Expand Up @@ -47,7 +47,7 @@
"type": "string"
},
"nonFilteredQueriesAllowed": {
"$ref": "../common/beaconCommonComponents.json#/definitions/NonFilteredQueriesAllowed"
"$ref": "../common/beaconCommonComponents.json#/$defs/NonFilteredQueriesAllowed"
},
"ontologyTermForThisType": {
"$ref": "../common/ontologyTerm.json",
Expand Down
4 changes: 2 additions & 2 deletions framework/json/configuration/entryTypesSchema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": true,
"definitions": {
"$defs": {
"EntryTypes": {
"additionalProperties": {
"$ref": "./entryTypeDefinition.json",
Expand All @@ -14,7 +14,7 @@
"description": "Schema for the Enrty Types list.",
"properties": {
"entryTypes": {
"$ref": "#/definitions/EntryTypes",
"$ref": "#/$defs/EntryTypes",
"description": "List of entry types."
}
},
Expand Down
Loading
Loading