Skip to content

Commit b187122

Browse files
committed
Add the scaffolding for the API structure.
1 parent a22bfab commit b187122

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ classifiers = [
3232
"Topic :: File Formats :: JSON :: JSON Schema",
3333
]
3434
dynamic = ["version"]
35+
dependencies = [
36+
"pyyaml",
37+
"referencing>=0.32.0",
38+
]
3539

3640

3741
[project.urls]

referencing_http/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
"""
2-
Fill me in!
2+
Serve your JSON registries over HTTP, for humans and machines alike!
33
"""
4+
from importlib.resources import files
5+
6+
import yaml
7+
8+
SPEC = yaml.safe_load(files(__package__).joinpath("api.yaml").read_text())

referencing_http/api.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
openapi: "3.1.0"
2+
info:
3+
title: An HTTP API for JSON (Schema) Registries
4+
description: |-
5+
Wrap a referencing.Registry Python object into an HTTP API.
6+
version: "1.0"
7+
paths:
8+
/list:
9+
get:
10+
summary: Retrieve a list of all URIs available in the registry.
11+
responses:
12+
"200":
13+
content:
14+
application/json:
15+
schema:
16+
const: 37
17+
/contents:
18+
get:
19+
summary: Retrieve the contents of the given URI.
20+
responses:
21+
"200":
22+
content:
23+
application/json:
24+
schema:
25+
const: 137

0 commit comments

Comments
 (0)