Skip to content

Commit 46c8dcc

Browse files
authored
Prefix all api routes with /v1/ to allow future increments (#952)
2 parents edf771d + af6f0ac commit 46c8dcc

24 files changed

+147
-72
lines changed

src/ssvc/api/main.py

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,7 @@
2727
from fastapi.responses import RedirectResponse
2828

2929
import ssvc # noqa: F401
30-
from ssvc.api.routers import (
31-
decision_point,
32-
decision_points,
33-
decision_table,
34-
decision_tables,
35-
keys,
36-
namespaces,
37-
objects,
38-
types,
39-
versions,
40-
)
30+
from ssvc.api.v1 import router as router_v1
4131
from ssvc.registry.base import (
4232
get_registry,
4333
)
@@ -54,15 +44,8 @@
5444
"email": "[email protected]",
5545
},
5646
)
57-
app.include_router(decision_point.router)
58-
app.include_router(decision_points.router)
59-
app.include_router(decision_table.router)
60-
app.include_router(decision_tables.router)
61-
app.include_router(types.router)
62-
app.include_router(namespaces.router)
63-
app.include_router(keys.router)
64-
app.include_router(versions.router)
65-
app.include_router(objects.router)
47+
48+
app.include_router(router_v1)
6649

6750

6851
# root should redirect to docs

src/ssvc/api/v1/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python
2+
"""
3+
API version 1 router for SSVC
4+
"""
5+
# Copyright (c) 2025 Carnegie Mellon University.
6+
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE
7+
# ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS.
8+
# CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND,
9+
# EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT
10+
# NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR
11+
# MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE
12+
# OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE
13+
# ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM
14+
# PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT.
15+
# Licensed under a MIT (SEI)-style license, please see LICENSE or contact
16+
# [email protected] for full terms.
17+
# [DISTRIBUTION STATEMENT A] This material has been approved for
18+
# public release and unlimited distribution. Please see Copyright notice
19+
# for non-US Government use and distribution.
20+
# This Software includes and/or makes use of Third-Party Software each
21+
# subject to its own license.
22+
# DM24-0278
23+
24+
from ssvc.api.v1.routers.v1_router import router_v1 as router # noqa: F401

src/ssvc/api/response_models/__init__.py renamed to src/ssvc/api/v1/response_models/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@
2121

2222
from pydantic import RootModel, model_validator
2323

24-
from ssvc.api.response_models._type_defs import (DecisionPointDictType, DecisionPointValuesListType,
25-
DecisionTableDictType, KeyDictType, NamespaceDictType, StringsListType,
26-
TypesDictType, VersionDictType)
24+
from ssvc.api.v1.response_models._type_defs import (
25+
DecisionPointDictType,
26+
DecisionPointValuesListType,
27+
DecisionTableDictType,
28+
KeyDictType,
29+
NamespaceDictType,
30+
StringsListType,
31+
TypesDictType,
32+
VersionDictType,
33+
)
2734
from ssvc.decision_points.base import DecisionPoint, DecisionPointValue
2835
from ssvc.decision_tables.base import DecisionTable
2936

File renamed without changes.

src/ssvc/api/routers/decision_points.py renamed to src/ssvc/api/v1/routers/decision_points.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from fastapi import APIRouter
2222

2323
from ssvc.api.helpers import _404_on_none
24-
from ssvc.api.response_models import (
24+
from ssvc.api.v1.response_models import (
2525
DecisionPointDictResponse,
2626
DecisionPointDictType,
2727
DecisionPointValueListResponse,

src/ssvc/api/routers/decision_tables.py renamed to src/ssvc/api/v1/routers/decision_tables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from fastapi import APIRouter
2323

2424
from ssvc.api.helpers import _404_on_none
25-
from ssvc.api.response_models import (
25+
from ssvc.api.v1.response_models import (
2626
DecisionTableDictResponse,
2727
DecisionTableDictType,
2828
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from fastapi import APIRouter
2323

2424
from ssvc.api.helpers import _404_on_none
25-
from ssvc.api.response_models import (
25+
from ssvc.api.v1.response_models import (
2626
KeyDictResponse,
2727
ListOfStringsResponse,
2828
StringsListType,

0 commit comments

Comments
 (0)