diff --git a/Makefile b/Makefile index 49ab0707..4b9119cc 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", .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 + 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",