Skip to main content

This project merges multiple OpenAPI specifications extensions into a single core specification for SKG IF.

Project description

ost-skg-if-api-tools

OSTrails - SKG IF - API - tools

How to run

  1. Clone the repository
  2. docker build -t skgif:test .
  3. docker compose up -d
  4. Visit http://localhost:8000/api/ver to see the nginx welcome page.
  5. Visit http://localhost:8000/api/ver/1.1.3/skg-if-api.yaml?ext=service to download the merged yaml file.
  6. (Optional) Visit http://localhost:8000/api/ver/1.1.3/skg-if-api.yaml?ext=service&nocache=yes to download the merged yaml file with cache disabled.

The stack will be up and running with fastapi on port 8000:8000 and nginx on port 8080:80

Config

The config file is config.toml in the root directory.

[api]
core_folder = "merge/API/core"
#core_fetching_url = "https://github.com/skg-if/api/openapi/ver/{version}/{filename}"
core_fetching_url = "http://nginx/{version}/{filename}"
ext_folder = "merge/API/ext"
output_folder = "merge/API/output"

[api.ext]
ext_postfix = [".yaml", ".yml"]

[cache]
sqlite_file = "cache.db"
  1. core_folder is the folder where the core yaml files are cached.
  2. When cache missing, the core yaml files will be fetched from core_fetching_url and saved in core_folder.
  3. {version} is the version of the core yaml file and {filename} is the filename of the core yaml file.
  4. ext_folder is the folder where the ext yaml files are stored.
  5. output_folder is the folder where the merged yaml files are saved. It serves as cache for the merged yaml files.
  6. ext_postfix is the postfix of the ext yaml filee, the yaml file can be .yaml or .yml.
  7. sqlite_file is the sqlite db where cache information is stored.

Note

For testing purpose, endpoint clear_cache is made to remove all the cache entries in the sqlite db.

The cache is not cleared. Same version of core with same ext will always be fetched from the cache. If user want to skip the cache and force a new merge, please use nocache=yes to force the cache miss.

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

ost_skg_if_api_tools-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ost_skg_if_api_tools-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file ost_skg_if_api_tools-0.1.1.tar.gz.

File metadata

File hashes

Hashes for ost_skg_if_api_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 eaf24fa2aa0827979c005f56aeec659e604a3c0408f93d60256fb128e79f779d
MD5 ff469250d6b66064fbfe8eee973d4028
BLAKE2b-256 a0459f85907f89ae6794c8214861f4ab4d8531bd61bb513e5235011a38b4ad91

See more details on using hashes here.

File details

Details for the file ost_skg_if_api_tools-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ost_skg_if_api_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a7dc19e96522de4fee8a3d4fe0d308feb10dd15ad69e489bb10964e341a52b2
MD5 4d73edc6e33bed64c2dbe730e5027054
BLAKE2b-256 a4505a3154d7a1e8a7fb7c35f1fb4e2586631e5de3dffb4657e8504ec7429da0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page