fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41096?usp=email )
Change subject: [REST] OpenAPI specification skeleton ......................................................................
[REST] OpenAPI specification skeleton
Change-Id: I84e6ef5cc67cd26b11f7bed8510420e43e18c69b Related: SYS#7066 --- M Makefile A contrib/openapi.yaml A contrib/yaml2json.py M debian/control A priv/openapi.json 5 files changed, 33 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/96/41096/1
diff --git a/Makefile b/Makefile index 6b9267d..ddc3dd5 100644 --- a/Makefile +++ b/Makefile @@ -12,11 +12,14 @@
all: build
-GEN_FILES = include/S1AP-*.hrl src/S1AP-*.erl +GEN_FILES = include/S1AP-*.hrl src/S1AP-*.erl priv/openapi.json
src/S1AP-%.erl include/S1AP-%.hrl: asn1/S1AP-%.asn rebar3 asn compile
+priv/openapi.json: contrib/openapi.yaml + contrib/yaml2json.py $^ > $@ + build: $(GEN_FILES) rebar3 compile
diff --git a/contrib/openapi.yaml b/contrib/openapi.yaml new file mode 100644 index 0000000..c7f7ec8 --- /dev/null +++ b/contrib/openapi.yaml @@ -0,0 +1,8 @@ +openapi: 3.0.0 +info: + version: '0.1.0' + title: 'OsmoS1GW REST interface' + +paths: + +components: diff --git a/contrib/yaml2json.py b/contrib/yaml2json.py new file mode 100755 index 0000000..b374f9b --- /dev/null +++ b/contrib/yaml2json.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +import sys +import yaml +import json + +with open(sys.argv[1], 'r') as f: + data = yaml.safe_load(f) + +json.dump(data, sys.stdout, indent=4) diff --git a/debian/control b/debian/control index b0bb9b4..f7e9258 100644 --- a/debian/control +++ b/debian/control @@ -6,6 +6,8 @@ libnftables-dev, rebar3, pkg-config, + python3:native, + python3-yaml:native, debhelper (>= 10) Standards-Version: 4.5.0 Vcs-Git: https://gitea.osmocom.org/erlang/osmo-s1gw diff --git a/priv/openapi.json b/priv/openapi.json new file mode 100644 index 0000000..25ff62a --- /dev/null +++ b/priv/openapi.json @@ -0,0 +1,9 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "0.1.0", + "title": "OsmoS1GW REST interface" + }, + "paths": null, + "components": null +} \ No newline at end of file