From 8224a5f58ed71d725f28b435972d41f971551232 Mon Sep 17 00:00:00 2001 From: Daniel Jonathan Date: Wed, 19 Nov 2025 12:08:14 -0600 Subject: [PATCH 1/2] fix(dotnet): make Makefile respect supportsStreamedListObjects config flag Previously, the dotnet SDK always built with streaming support enabled, ignoring the supportsStreamedListObjects config flag. The Makefile unconditionally called build-client-streamed which hardcoded the x-streaming flag in the OpenAPI spec. Changes: - Modified build-client-dotnet to check config flag value - Added build-client-non-streamed target for non-streaming builds - Added build-openapi-non-streamed to remove streaming endpoint from spec - Default remains false since SendStreamingRequestAsync is not yet implemented The flag now works correctly - when set to false, the streaming endpoint is completely removed from the generated SDK. --- Makefile | 22 ++++++++++++++++++++- config/clients/dotnet/config.overrides.json | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 49ab0707..61b2c82b 100644 --- a/Makefile +++ b/Makefile @@ -107,7 +107,13 @@ test-client-dotnet: build-client-dotnet build-dotnet-multi-image .PHONY: build-client-dotnet build-client-dotnet: build-dotnet-multi-image - make build-client-streamed sdk_language=dotnet tmpdir=${TMP_DIR} OPENAPI_GENERATOR_CLI_DOCKER_TAG=v7.11.0 + @if grep -q '"supportsStreamedListObjects": true' config/clients/dotnet/config.overrides.json; then \ + echo "Building dotnet SDK with streaming support..."; \ + make build-client-streamed sdk_language=dotnet tmpdir=${TMP_DIR} OPENAPI_GENERATOR_CLI_DOCKER_TAG=v7.11.0; \ + else \ + echo "Building dotnet SDK without streaming support..."; \ + make build-client-non-streamed sdk_language=dotnet tmpdir=${TMP_DIR} OPENAPI_GENERATOR_CLI_DOCKER_TAG=v7.11.0; \ + fi make run-in-docker sdk_language=dotnet image=openfga/dotnet-multi:${DOTNET_DOCKER_TAG} command="/bin/sh -c 'dotnet build --configuration Release'" # Workaround for dotnet format issue: https://github.com/dotnet/format/issues/1634 @@ -199,6 +205,11 @@ build-client-streamed: build-openapi-streamed SDK_LANGUAGE="${sdk_language}" TMP_DIR="${tmpdir}" LIBRARY_TEMPLATE="${library}"\ ./scripts/build_client.sh +.PHONY: build-client-non-streamed +build-client-non-streamed: build-openapi-non-streamed + SDK_LANGUAGE="${sdk_language}" TMP_DIR="${tmpdir}" LIBRARY_TEMPLATE="${library}"\ + ./scripts/build_client.sh + .PHONY: build-openapi-streamed build-openapi-streamed: init get-openapi-doc cat "${DOCS_CACHE_DIR}/openfga.openapiv2.raw.json" | \ @@ -208,6 +219,15 @@ build-openapi-streamed: init get-openapi-doc sed -i -e 's/#\/definitions\/Object"/#\/definitions\/FgaObject"/g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json sed -i -e 's/v1.//g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json +.PHONY: build-openapi-non-streamed +build-openapi-non-streamed: init get-openapi-doc + cat "${DOCS_CACHE_DIR}/openfga.openapiv2.raw.json" | \ + jq '(.. | .tags? | select(.)) |= ["OpenFga"] | (.tags? | select(.)) |= [{"name":"OpenFga"}] | del(.definitions.ReadTuplesParams, .definitions.ReadTuplesResponse, .paths."/stores/{store_id}/read-tuples", .paths."/stores/{store_id}/streamed-list-objects")' > \ + ${DOCS_CACHE_DIR}/openfga.openapiv2.json + sed -i -e 's/"Object"/"FgaObject"/g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json + sed -i -e 's/#\/definitions\/Object"/#\/definitions\/FgaObject"/g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json + sed -i -e 's/v1.//g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json + .PHONY: get-openapi-doc get-openapi-doc: mkdir -p "${DOCS_CACHE_DIR}" diff --git a/config/clients/dotnet/config.overrides.json b/config/clients/dotnet/config.overrides.json index bb5e6b36..8a950c4e 100644 --- a/config/clients/dotnet/config.overrides.json +++ b/config/clients/dotnet/config.overrides.json @@ -37,7 +37,7 @@ "hashCodeBasePrimeNumber": 9661, "hashCodeMultiplierPrimeNumber": 9923, "openTelemetryDocumentation": "OpenTelemetry.md", - "supportsStreamedListObjects": true, + "supportsStreamedListObjects": false, "files": { "constants.mustache": { "destinationFilename": "src/OpenFga.Sdk/Constants/FgaConstants.cs", From c084096ec050d6eed759749cf54bb5dd3f72c7fb Mon Sep 17 00:00:00 2001 From: Daniel Jonathan Date: Wed, 19 Nov 2025 12:20:46 -0600 Subject: [PATCH 2/2] fix(dotnet): remove orphaned streaming model definitions Address CodeRabbit feedback to also remove StreamedListObjectsResponse and StreamResultOfStreamedListObjectsResponse definitions from the non-streamed OpenAPI spec, not just the endpoint path. This ensures no orphaned model definitions remain when streaming support is disabled. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 61b2c82b..4b9119cc 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,7 @@ build-openapi-streamed: init get-openapi-doc .PHONY: build-openapi-non-streamed build-openapi-non-streamed: init get-openapi-doc cat "${DOCS_CACHE_DIR}/openfga.openapiv2.raw.json" | \ - jq '(.. | .tags? | select(.)) |= ["OpenFga"] | (.tags? | select(.)) |= [{"name":"OpenFga"}] | del(.definitions.ReadTuplesParams, .definitions.ReadTuplesResponse, .paths."/stores/{store_id}/read-tuples", .paths."/stores/{store_id}/streamed-list-objects")' > \ + jq '(.. | .tags? | select(.)) |= ["OpenFga"] | (.tags? | select(.)) |= [{"name":"OpenFga"}] | del(.definitions.ReadTuplesParams, .definitions.ReadTuplesResponse, .paths."/stores/{store_id}/read-tuples", .definitions.StreamedListObjectsResponse, .definitions.StreamResultOfStreamedListObjectsResponse, .paths."/stores/{store_id}/streamed-list-objects")' > \ ${DOCS_CACHE_DIR}/openfga.openapiv2.json sed -i -e 's/"Object"/"FgaObject"/g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json sed -i -e 's/#\/definitions\/Object"/#\/definitions\/FgaObject"/g' ${DOCS_CACHE_DIR}/openfga.openapiv2.json