This project merges multiple OpenAPI specifications extensions into a single core specification for SKG IF.
Project description
OpenAPI merge spec
Installation
uv add ost-skg-if-api-tools
#or
pip install ost-skg-if-api-tools
Usage
- as a command line tool:
source .venv/bin/activate
merge merge/API/core/skg-if-api.yaml merge/API/ext/service.yaml
there can be more than one extension file, e.g. merge/API/ext/service.yaml merge/API/ext/another.yaml
2. as a python module:
from merge.merge import load_and_merge
load_and_merge(
core_file="merge/API/core/skg-if-api.yaml",
ext_files=["merge/API/ext/service.yaml", "merge/API/ext/another.yaml"]
)
- as a web service: TBD
Specify what should be changed in/added to the SKG-IF OpenAPI YAML, which supports the core SKG-IF data model, for an extension. RThis document will use an example server extension.
Header
Identify the extension. Potentially specify which extension(s) it extends and should already have been merged in the core OpenAPI YAML.
extension: service
# depends-on: foo
# depends-on: bar
skg-if-api:
Add tags
Add one or more tags. Each tag key, e.g. tag-service, should be unique. The + prefix tells the merger to add the tag.
+tag-service:
name: Service
description: Lorem ipsum dolor sit amet.
#+tag-another:
Add schemas
Add one or more schemas. Each schema key, e.g. path-service, should be unique. The + prefix tells the merger to add the schema.
+path-service:
'/services/{local_identifier}':
get:
tags:
- Service
...
+path-services:
'/services':
get:
tags:
- Service
...
Modify a schema
Modify an existing (core) schema. Add the ~ prefix to the key of the schema to modify. Then copy all the steps that are needed to get to where a field has to be added or modified. In the example below its up to properties, to which services is added indicated by the + prefix. To step into the right item of a list the right position can be achieved with empty - items. The ~enum showcases a modification of its value list, i.e. adding the portal value.
~schema-venue:
Venue:
allOf:
-
- type: object
properties:
type:
~enum: portal
+services:
type: array
items:
$ref: '#/components/schemas/Service'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ost_skg_if_api_tools-0.1.4.tar.gz.
File metadata
- Download URL: ost_skg_if_api_tools-0.1.4.tar.gz
- Upload date:
- Size: 46.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e034cbc38fc4eca1b3f87c5a4972e123277e85c4a71034df4b950bac9bee1e44
|
|
| MD5 |
1b858f91848472ac42bf1b8d8a36249d
|
|
| BLAKE2b-256 |
8a9eeae9cc16aadeae4a74d91371e239131b7807bc40d641de77ab468cb0f6c4
|
File details
Details for the file ost_skg_if_api_tools-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ost_skg_if_api_tools-0.1.4-py3-none-any.whl
- Upload date:
- Size: 49.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9275a8e9e490df8b13746c99fa1bbe743aec0805b60fa38bac1e0345b8197f10
|
|
| MD5 |
4cc51ab796ad3d4f869521ca46e32b7c
|
|
| BLAKE2b-256 |
8c587794da0fdabc85070076d389e78095ba9dc1a3383c86ded047fcde44a49f
|