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

Add option to validate endpoint for ensure-latest-cedar-version #645

Open
shirey opened this issue Oct 15, 2024 · 0 comments
Open

Add option to validate endpoint for ensure-latest-cedar-version #645

shirey opened this issue Oct 15, 2024 · 0 comments
Assignees

Comments

@shirey
Copy link
Member

shirey commented Oct 15, 2024

Based on the description below of how to verify the latest version of a CEDAR template using the CEDAR API add an optional query parameter to the POST /metadata/validate, ensure-latest-cedar-version=true which, when included will extract the metadata_schema_id field from the uploaded metadata file and call the CEDAR ../versions endpoint to verify that it is the latest version of the schema (as specified in above ingest-ui #1487). If not the latest version return a 400 response with the message "This is not the latest version of the metadata specification as defined in CEDAR"

This new option will be used in ingest-ui #1487.

To ascertain if a CEDAR template is the latest version of the template call https://resource.metadatacenter.org/templates/<url encoded template id>/versions where the <url encoded template id> is constructed from value in the .tsv file in column metadata_schema_id and the url https://repo.metadatacenter.org/templates/<template id>. (api_key needed see below for curl example). Parse the output to make sure that the entry with is_latest_version == true` has the same template id as the one that is in the uploaded tsv.

curl -X GET --header 'Accept: application/json' --header 'Authorization: apiKey <api key>' 'https://resource.metadatacenter.org/templates/https%3A%2F%2Frepo.metadatacenter.org%2Ftemplates%2F<template id>/versions'

Where

  • is the HuBMAP API Key for the CEDAR API
  • is the template id (metadata_schema_id) from the .tsv file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants