Skip to content

[codex] Wrap generated OpenAPI models behind facade#164

Draft
tkilias wants to merge 1 commit into
mainfrom
codex/openapi-facade-wrappers
Draft

[codex] Wrap generated OpenAPI models behind facade#164
tkilias wants to merge 1 commit into
mainfrom
codex/openapi-facade-wrappers

Conversation

@tkilias
Copy link
Copy Markdown
Collaborator

@tkilias tkilias commented May 12, 2026

Summary

Replace generated OpenAPI model leakage from the handwritten client package with handwritten wrapper types.

What Changed

  • added handwritten facade wrapper types for status, API errors, databases, clusters, connections, and allowed IPs
  • updated the facade to convert generated OpenAPI responses into handwritten wrappers before returning them
  • switched api_access.py and package-level PROMISING_STATES usage to the handwritten wrapper surface
  • updated unit and integration-facing type imports to use the facade wrappers

Why

The previous facade still exposed generated classes from exasol.saas.client.openapi, which kept the generated API surface coupled to the handwritten client layer.

Impact

The handwritten client package now presents a stable wrapper surface instead of forwarding generated models directly.

Validation

  • python -m py_compile exasol/saas/client/openapi_facade_types.py exasol/saas/client/openapi_facade.py exasol/saas/client/init.py exasol/saas/client/api_access.py test/unit/test_api_access.py test/unit/test_ensure_type.py test/integration/conftest.py test/integration/test_databases.py test/integration/test_allowed_ip.py
  • pytest was not run in this environment because it is not installed

@tkilias tkilias deployed to manual-approval May 12, 2026 13:35 — with GitHub Actions Active
Comment thread exasol/saas/client/api_access.py
db = None
try:
db = self.create_database(name, idle_time=idle_time)
yield db
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a non-facade data type, I guess.
Will be solved by changing the return type of self.create_database().
Maybe we should add a type hint to this context manager?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for answering my other comment.
Then only the type hint could be an optional improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants