{"library":"connexion","code":"import connexion\nfrom pathlib import Path\n\n# app.py\n\ndef get_hello():\n    return {\"message\": \"Hello from Connexion!\"}, 200\n\n# Create the Connexion app using AsyncApp for ASGI compatibility\n# and look for the OpenAPI spec in the current directory.\napp = connexion.AsyncApp(__name__, specification_dir='.')\n\n# Add the API defined in openapi.yaml\napp.add_api('openapi.yaml')\n\n# To run the application (requires 'pip install connexion[uvicorn]')\n# if __name__ == \"__main__\":\n#     import uvicorn\n#     uvicorn.run(app, host=\"0.0.0.0\", port=8080)\n\n# For external running (e.g., via command line: uvicorn app:app --reload)\n# Define your OpenAPI spec in openapi.yaml in the same directory:\n# openapi: 3.0.0\n# info:\n#   title: Simple Hello API\n#   version: 1.0.0\n# paths:\n#   /hello:\n#     get:\n#       operationId: app.get_hello  # Links to the get_hello function in app.py\n#       responses:\n#         '200':\n#           description: A greeting\n#           content:\n#             application/json:\n#               schema:\n#                 type: object\n#                 properties:\n#                   message:\n#                     type: string","lang":"python","description":"This quickstart demonstrates how to create a simple 'Hello World' API using Connexion's `AsyncApp` (ASGI backend). It defines an API using an `openapi.yaml` specification file and links an operation to a Python function. The application can be run using `uvicorn` (e.g., `uvicorn app:app --reload` from the command line, assuming the Python file is named `app.py`). Ensure `openapi.yaml` is in the same directory as `app.py`.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}