Open redmitry opened 2 months ago
Hi @redmitry. Link to the presentation gives 404. Do you have it elsewhere?
Hi @redmitry. Link to the presentation gives 404. Do you have it elsewhere?
Fixed.
Basically, OpenAPI ResultsOKResponse may have something like
"oneOf": [
{
"$comment": "generics test",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"$defs": {
"biosamples": {
"$dynamicAnchor": "resultsEntryType",
"$ref": "https://raw.githubusercontent.com/redmitry/beacon-v2/redmitry-generalize-resultset/models/json/beacon-v2-default-model/biosamples/defaultSchema.json"
}
},
"$ref" : "https://raw.githubusercontent.com/redmitry/beacon-v2/redmitry-generalize-resultset/framework/json/responses/beaconResultsetsResponse.json"
},
...
]
The schema above validates ResultsetsResponse where resultSets are biosamples entryType.
D.
I have tested this and it worked fine. For me it's a +1. We would need a proposal on how endpoints would look like using this schema composition.
The main idea is defined in the short presentation Generalizing Beacon 2.0 Schema (presented at GA4GH Discovery Workstream 2024-04-09). This doesn't break framework format, but put the requirement for support 2020-12 JSON schema (which is already supposed to be Beacon v2.0 JSON schema version).
The improvement would allow:
Cheers,
Dmitry