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.2.tar.gz (45.1 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.2-py3-none-any.whl (48.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ost_skg_if_api_tools-0.1.2.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.13

File hashes

Hashes for ost_skg_if_api_tools-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4bd2ba8ab27bcd0e609f139796b8f44b69e0d6cca84e9cbc5ab1cb8dc476d308
MD5 756f83c49e8ef709f6190be91c53dd29
BLAKE2b-256 b4405e67b67f94e990cc4c4fa24257467e6cb62c9e41af8035641e4b55c639c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ost_skg_if_api_tools-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 650f8da3602dbc111177d8e3ffc84a56cbaf84e68a1d430b58ede12163d20a1e
MD5 9a91bf51f4ee7e06a65ea923d11d4280
BLAKE2b-256 6e3f010ba9f21be3c916b2378288f8edc0013f0efa89b85541a1b62168c935ec

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