diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0ee8c01..816df2d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.3.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index dc07b8c..00cf72d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [0.3.1](https://github.com/scalar/galaxy-python/compare/v0.3.0...v0.3.1) (2026-09-15) + + +### ⚠ BREAKING CHANGES + +* **api:** 3 breaking changes to the SDK surface. + - Property `planet.habitabilityIndex` type changed from `number` to `number`. + - Property `planet.physicalProperties` type changed from `object` to `object`. + - Property `planet.atmosphere` type changed from `Array` to `Array`. + +### Features + +* **api:** update property planet.habitabilityIndex (+3 more changes) ([d13d692](https://github.com/scalar/galaxy-python/commit/d13d6924e0ac598bf7b9ae53dfee2d3648d597c1)) + + +### Chores + +* **api:** regenerate SDK ([c83f53e](https://github.com/scalar/galaxy-python/commit/c83f53eacd51c58ddd59f4ec94693f947b71694a)) +* **api:** regenerate SDK ([c9ecb15](https://github.com/scalar/galaxy-python/commit/c9ecb1505b78dae1c365af49b3471faad18e48b6)) +* **api:** update generated SDK content ([39f800d](https://github.com/scalar/galaxy-python/commit/39f800dceb4381e9ecadf9c4d3aa3269c77161bf)) +* release 0.3.1 ([dc89444](https://github.com/scalar/galaxy-python/commit/dc8944438ab9e6c25c3e8ae126ca1be3314285cb)) +* release 0.3.1 ([ecd956e](https://github.com/scalar/galaxy-python/commit/ecd956ebd75dfa41ba928d7064a41b946711248a)) + ## [0.3.0](https://github.com/scalar/galaxy-python/compare/v0.2.1...v0.3.0) (2026-08-28) diff --git a/pyproject.toml b/pyproject.toml index 7116b1d..0cd6a90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "scalar-galaxy" -version = "0.3.0" # x-release-please-version +version = "0.3.1" # x-release-please-version description = "The Scalar Galaxy is an example OpenAPI document to test OpenAPI tools and libraries. It's a fictional universe with fictional planets and fictional data." readme = "README.md" license = "Apache-2.0" diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json index 2a801e0..bcf6b4f 100644 --- a/scalar-sdk.manifest.json +++ b/scalar-sdk.manifest.json @@ -1,7 +1,7 @@ { "name": "ScalarGalaxy", "slug": "scalarGalaxy", - "generatorVersion": "0.30.1", + "generatorVersion": "0.32.14", "servers": [ "https://galaxy.scalar.com", "{protocol}://void.scalar.com/{path}" @@ -379,7 +379,10 @@ "kind": "primitive", "type": "number", "format": "float", - "validation": {} + "validation": { + "minimum": 0, + "maximum": 1 + } } }, { @@ -404,7 +407,10 @@ "type": { "kind": "primitive", "type": "number", - "format": "float" + "format": "float", + "validation": { + "exclusiveMinimum": 0 + } } }, { @@ -421,7 +427,10 @@ "type": { "kind": "primitive", "type": "number", - "format": "float" + "format": "float", + "validation": { + "exclusiveMinimum": 0 + } } }, { @@ -556,7 +565,10 @@ "type": { "kind": "primitive", "type": "number", - "format": "float" + "format": "float", + "validation": { + "exclusiveMaximum": 100 + } } } ], @@ -1600,7 +1612,27 @@ "publicAliases": [] }, "errorResponses": [], - "responseLinks": [], + "responseLinks": [ + { + "status": "200", + "name": "GetFirstPlanet", + "description": "Retrieve the first planet when the response contains at least one planet.", + "operationId": "getPlanet", + "parameters": { + "path.planetId": "$response.body#/data/0/id" + } + }, + { + "status": "200", + "name": "FirstPage", + "description": "Return to the first page using the requested page size.", + "operationId": "getAllData", + "parameters": { + "query.limit": "$request.query.limit", + "query.offset": "0" + } + } + ], "transport": "http" }, { @@ -1805,7 +1837,27 @@ ] } ], - "responseLinks": [], + "responseLinks": [ + { + "status": "201", + "name": "GetPlanet", + "description": "Retrieve the planet using the ID returned in the response.", + "operationId": "getPlanet", + "parameters": { + "planetId": "$response.body#/id" + } + }, + { + "status": "201", + "name": "UpdatePlanet", + "description": "Update the created planet using its ID and response body.", + "operationRef": "#/paths/~1planets~1%7BplanetId%7D/put", + "parameters": { + "planetId": "$response.body#/id" + }, + "requestBody": "$response.body" + } + ], "transport": "http" }, { @@ -1891,7 +1943,17 @@ ] } ], - "responseLinks": [], + "responseLinks": [ + { + "status": "200", + "name": "DeletePlanet", + "description": "Delete this planet using the ID from the request path.", + "operationId": "deletePlanet", + "parameters": { + "planetId": "$request.path.planetId" + } + } + ], "transport": "http" }, { @@ -2119,7 +2181,17 @@ ] } ], - "responseLinks": [], + "responseLinks": [ + { + "status": "200", + "name": "GetPlanet", + "description": "Retrieve the planet using the ID returned in the response.", + "operationId": "getPlanet", + "parameters": { + "planetId": "$response.body#/id" + } + } + ], "transport": "http" }, { diff --git a/src/scalar_galaxy/_streaming.py b/src/scalar_galaxy/_streaming.py index 659354f..9cf783b 100644 --- a/src/scalar_galaxy/_streaming.py +++ b/src/scalar_galaxy/_streaming.py @@ -56,33 +56,8 @@ def __stream__(self) -> Iterator[_T]: response = self.response process_data = self._client._process_response_data iterator = self._iter_events() - content_type = (response.headers.get("content-type") or "").lower() - is_jsonl = "json" in content_type and "event-stream" not in content_type try: - if is_jsonl: - # Newline-delimited JSON (`application/jsonl`, - # `application/x-jsonl`, etc.) has no SSE framing, so the - # `_decoder.iter_bytes` path above would never yield. We - # parse each non-empty line as one event so callers can - # iterate without caring whether the wire format is SSE - # or JSONL. - buffer = b"" - for chunk in response.iter_bytes(): - if not chunk: - continue - buffer += chunk - while b"\n" in buffer: - line, buffer = buffer.split(b"\n", 1) - text = line.decode("utf-8").strip() - if not text: - continue - yield process_data(data=json.loads(text), cast_to=cast_to, response=response) - tail = buffer.decode("utf-8").strip() - if tail: - yield process_data(data=json.loads(tail), cast_to=cast_to, response=response) - return - for sse in iterator: if not sse.data: continue @@ -153,28 +128,8 @@ async def __stream__(self) -> AsyncIterator[_T]: response = self.response process_data = self._client._process_response_data iterator = self._iter_events() - content_type = (response.headers.get("content-type") or "").lower() - is_jsonl = "json" in content_type and "event-stream" not in content_type try: - if is_jsonl: - # See the sync sibling for why JSONL gets its own branch. - buffer = b"" - async for chunk in response.aiter_bytes(): - if not chunk: - continue - buffer += chunk - while b"\n" in buffer: - line, buffer = buffer.split(b"\n", 1) - text = line.decode("utf-8").strip() - if not text: - continue - yield process_data(data=json.loads(text), cast_to=cast_to, response=response) - tail = buffer.decode("utf-8").strip() - if tail: - yield process_data(data=json.loads(tail), cast_to=cast_to, response=response) - return - async for sse in iterator: if not sse.data: continue diff --git a/src/scalar_galaxy/_version.py b/src/scalar_galaxy/_version.py index 30c8c73..58cf69a 100644 --- a/src/scalar_galaxy/_version.py +++ b/src/scalar_galaxy/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Scalar. See README.md for details. __title__ = "scalarGalaxy" -__version__ = "0.3.0" # x-release-please-version +__version__ = "0.3.1" # x-release-please-version diff --git a/tests/smoke-test.py b/tests/smoke-test.py index 07fd5a9..6997cf3 100644 --- a/tests/smoke-test.py +++ b/tests/smoke-test.py @@ -65,12 +65,12 @@ def _smoke_case_2() -> None: type="terrestrial", habitability_index=0.68, physical_properties={"mass": 0.107, "radius": 0.532, "gravity": 0.378, "temperature": {}}, - atmosphere=[], + atmosphere=[{}], discovered_at="1610-01-07T00:00:00Z", image="https://cdn.scalar.com/photos/mars.jpg", - satellites=[], + satellites=[{"name": "Phobos"}], creator={"name": "Marc"}, - tags=[], + tags=["solar-system", "rocky", "explored"], success_callback_url="https://example.com/webhook", failure_callback_url="https://example.com/webhook", ) @@ -97,12 +97,12 @@ def _smoke_case_5() -> None: type="terrestrial", habitability_index=0.68, physical_properties={"mass": 0.107, "radius": 0.532, "gravity": 0.378, "temperature": {}}, - atmosphere=[], + atmosphere=[{}], discovered_at="1610-01-07T00:00:00Z", image="https://cdn.scalar.com/photos/mars.jpg", - satellites=[], + satellites=[{"name": "Phobos"}], creator={"name": "Marc"}, - tags=[], + tags=["solar-system", "rocky", "explored"], success_callback_url="https://example.com/webhook", failure_callback_url="https://example.com/webhook", ) @@ -140,12 +140,12 @@ def _smoke_case_10() -> None: type="terrestrial", habitability_index=0.68, physical_properties={"mass": 0.107, "radius": 0.532, "gravity": 0.378, "temperature": {}}, - atmosphere=[], + atmosphere=[{}], discovered_at="1610-01-07T00:00:00Z", image="https://cdn.scalar.com/photos/mars.jpg", - satellites=[], + satellites=[{"name": "Phobos"}], creator={"name": "Marc"}, - tags=[], + tags=[""], success_callback_url="https://example.com/webhook", failure_callback_url="https://example.com/webhook", )