From b544331247376d4435bb76c01a49363a28a80885 Mon Sep 17 00:00:00 2001 From: Donny Winston Date: Thu, 16 Nov 2023 15:00:39 -0500 Subject: [PATCH] add typecodes enpoint (#386) unauthenticated. closes #385 --- nmdc_runtime/api/endpoints/nmdcschema.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nmdc_runtime/api/endpoints/nmdcschema.py b/nmdc_runtime/api/endpoints/nmdcschema.py index a07a76a2..4d7c9032 100644 --- a/nmdc_runtime/api/endpoints/nmdcschema.py +++ b/nmdc_runtime/api/endpoints/nmdcschema.py @@ -2,6 +2,8 @@ import pymongo from fastapi import APIRouter, Depends, HTTPException + +from nmdc_runtime.minter.config import typecodes from nmdc_runtime.util import nmdc_database_collection_names from pymongo.database import Database as MongoDatabase from starlette import status @@ -37,6 +39,11 @@ def get_nmdc_schema_version(): return version("nmdc_schema") +@router.get("/nmdcschema/typecodes") +def get_nmdc_schema_typecodes(): + return typecodes() + + @router.get("/nmdcschema/collection_stats") def get_nmdc_database_collection_stats( mdb: MongoDatabase = Depends(get_mongo_db),