Refactor OpenAPI fetcher for improved clarity and robustness

Reorganized and enhanced the OpenAPI fetch logic for better maintainability and error handling. Key updates include improved environment variable validation, more detailed error messages, streamlined configuration loading, and additional safety checks for file paths and directories. Added proper logging and ensured the process flow is easy to trace.
This commit is contained in:
GotthardG 2024-12-18 10:56:22 +01:00
parent cb3225b760
commit ea15dbb555
3 changed files with 5 additions and 2 deletions

View File

@ -42,6 +42,9 @@ app = FastAPI(
title=project_name,
description="Backend for next-gen sample management system",
version=project_version,
servers=[
{"url": "https://mx-aare-test.psi.ch:1492", "description": "Default server"}
],
)
# Determine environment and configuration file path

View File

@ -36,7 +36,7 @@ java -jar openapi-generator-cli.jar generate \
-i openapi.json \
-o python-client/ \
-g python \
--additional-properties=packageName="${NAME}_client",projectName="${NAME}",packageVersion="${VERSION}"
--additional-properties=packageName="${NAME}client",projectName="${NAME}",packageVersion="${VERSION}"
if [[ ! -d python-client ]]; then
echo "Error: Failed to generate Python client."

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "aareDB"
version = "0.1.0a4"
version = "0.1.0a5"
description = "Backend for next gen sample management system"
authors = [{name = "Guillaume Gotthard", email = "guillaume.gotthard@psi.ch"}]
license = {text = "MIT"}