Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

---

## [0.7.1] — 2026-11-13

### Fixed

- `/openapi.json` now reports the API's real version in `info.version`. It showed FastAPI's default `0.1.0`, so the docs site, which syncs the spec, showed it too.

---

## [0.7.0] — 2026-11-13

### Added
Expand Down
2 changes: 1 addition & 1 deletion api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.0"
__version__ = "0.7.1"
2 changes: 2 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from slowapi.middleware import SlowAPIMiddleware
from starlette.exceptions import HTTPException as StarletteHTTPException

from api import __version__
from api.cache.factory import build_historical_service
from api.cache.historical import COOLDOWN_MESSAGE, PSX_COOLDOWN_SECONDS
from api.dependencies import limiter
Expand Down Expand Up @@ -44,6 +45,7 @@ async def lifespan(app: FastAPI):

app = FastAPI(
title="psxdata",
version=__version__,
lifespan=lifespan,
servers=[{"url": "https://psxdata-api.fastapicloud.dev"}],
telemetry=TELEMETRY.config,
Expand Down
17 changes: 17 additions & 0 deletions tests/api/test_openapi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Unit tests for GET /openapi.json."""
import pytest
from fastapi.testclient import TestClient

import api
from api.main import app


@pytest.fixture
def client() -> TestClient:
return TestClient(app)


def test_openapi_version_matches_package_version(client: TestClient) -> None:
resp = client.get("/openapi.json")
assert resp.status_code == 200
assert resp.json()["info"]["version"] == api.__version__
Loading