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

Generalize ResultsetInstance #162

Open
redmitry opened this issue Sep 12, 2024 · 3 comments
Open

Generalize ResultsetInstance #162

redmitry opened this issue Sep 12, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@redmitry
Copy link
Collaborator

redmitry commented Sep 12, 2024

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:

  1. Validate beaconResultsetsResponse together with concrete results (e.g. "individuals") entryTypes in one pass.
  2. OpenAPI tools may (if supports 2020-12) generate better clients that include data model types.

Cheers,

Dmitry

@redmitry redmitry added the enhancement New feature or request label Sep 12, 2024
@redmitry redmitry self-assigned this Sep 12, 2024
redmitry added a commit to redmitry/beacon-v2 that referenced this issue Sep 12, 2024
Provide generic type for results via $dynamicRef / $dynamicAnchor.
(ga4gh-beacon#162)
@costero-e
Copy link
Collaborator

Hi @redmitry. Link to the presentation gives 404. Do you have it elsewhere?

@redmitry
Copy link
Collaborator Author

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.

@costero-e
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants