diff --git a/.github/ISSUE_TEMPLATE/01-kiota-bug.yml b/.github/ISSUE_TEMPLATE/01-kiota-bug.yml index d0407046c2..c57677cabc 100644 --- a/.github/ISSUE_TEMPLATE/01-kiota-bug.yml +++ b/.github/ISSUE_TEMPLATE/01-kiota-bug.yml @@ -32,11 +32,11 @@ body: - type: dropdown id: language attributes: - label: Client Library/SDK Language + label: Client library/SDK language description: If Client SDK, what's the language in use? multiple: false options: - - C# + - Csharp - CLI - Go - Java @@ -45,6 +45,7 @@ body: - Python - Ruby - TypeScript + - Swift validations: required: false - type: textarea diff --git a/.github/ISSUE_TEMPLATE/02-kiota-feature-request.yml b/.github/ISSUE_TEMPLATE/02-kiota-feature-request.yml index 6bc778d746..4962149da7 100644 --- a/.github/ISSUE_TEMPLATE/02-kiota-feature-request.yml +++ b/.github/ISSUE_TEMPLATE/02-kiota-feature-request.yml @@ -21,7 +21,7 @@ body: description: Is feature request related to any client library/SDK language? multiple: false options: - - C# + - Csharp - CLI - Go - Java @@ -30,6 +30,7 @@ body: - Python - Ruby - TypeScript + - Swift validations: required: false - type: textarea diff --git a/.github/workflows/graphprojects.yml b/.github/workflows/project-auto-add.yml similarity index 53% rename from .github/workflows/graphprojects.yml rename to .github/workflows/project-auto-add.yml index f697bf9b89..00534c925a 100644 --- a/.github/workflows/graphprojects.yml +++ b/.github/workflows/project-auto-add.yml @@ -1,12 +1,19 @@ -# This workflow is used to add new issues to GitHub Projects (Beta) +# This workflow is used to add new issues to GitHub Kiota Project -name: Add PR to project +name: Add Issue or PR to project on: issues: types: - opened + pull_request: + types: + - opened + branches: + - "main" + jobs: track_issue: + if: github.actor != 'dependabot[bot]' runs-on: ubuntu-latest steps: - name: Generate token @@ -16,11 +23,26 @@ jobs: app_id: ${{ secrets.GRAPHBOT_APP_ID }} private_key: ${{ secrets.GRAPHBOT_APP_PEM }} + - name: Check if issue has language specified + env: + ISSUE_BODY: ${{github.event.issue.body}} + run: | + language=$(awk '/SDK language/{flag=1;next} /Describe/{flag=0} flag' <<< "$ISSUE_BODY" | tr -d '[:space:]') + allowedList="PHP Python Go TypeScript Csharp Java PowerShell CLI Ruby Swift" + if [[ $allowedList =~ (^|[[:space:]])$language($|[[:space:]]) ]]; then + echo "$language is in allowed list"; + echo 'LANGUAGE='$language >> $GITHUB_ENV; + echo 'SELECTED_LANGUAGE='$language >> $GITHUB_ENV; + else + echo "$language is not allowed"; + echo 'SELECTED_LANGUAGE=Multiple Languages' >> $GITHUB_ENV; + fi + - name: Get project data env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - ORGANIZATION: microsoftgraph - PROJECT_NUMBER: 28 + ORGANIZATION: microsoft + PROJECT_NUMBER: 220 run: | gh api graphql -f query=' query($org: String!, $number: Int!) { @@ -44,13 +66,14 @@ jobs: }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'TRIAGE_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Needs Triage 🔍") |.id' project_data.json) >> $GITHUB_ENV + echo 'LANGUAGE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Language") | .id' project_data.json) >> $GITHUB_ENV + LANGUAGE_OPTION_ID=$(jq --arg lang "$SELECTED_LANGUAGE" '.data.organization.projectV2.fields.nodes[] | select(.name== "Language") | .options[] | select(.name==$lang) | .id' project_data.json) + echo "LANGUAGE_OPTION_ID=$LANGUAGE_OPTION_ID" >> $GITHUB_ENV - - name: Add Issue to project + - name: Add Issue or PR to project env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} - ISSUE_ID: ${{ github.event.issue.node_id }} + ISSUE_ID: ${{ github.event_name == 'issues' && github.event.issue.node_id || github.event.pull_request.node_id }} run: | item_id="$( gh api graphql -f query=' mutation($project:ID!, $issue:ID!) { @@ -60,10 +83,10 @@ jobs: } } }' -f project=$PROJECT_ID -f issue=$ISSUE_ID --jq '.data.addProjectV2ItemById.item.id')" - + echo 'ITEM_ID='$item_id >> $GITHUB_ENV - - name: Set Triage + - name: Set Language env: GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} run: | @@ -71,17 +94,17 @@ jobs: mutation ( $project: ID! $item: ID! - $status_field: ID! - $status_value: String! + $language_field: ID! + $language_value: String! ) { set_status: updateProjectV2ItemFieldValue(input: { projectId: $project itemId: $item - fieldId: $status_field - value: {singleSelectOptionId: $status_value} + fieldId: $language_field + value: {singleSelectOptionId: $language_value} }) { projectV2Item { id } } - }' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value=${{ env.TRIAGE_OPTION_ID }} --silent + }' -f project=$PROJECT_ID -f item=$ITEM_ID -f language_field=$LANGUAGE_FIELD_ID -f language_value=${{ env.LANGUAGE_OPTION_ID }} --silent diff --git a/CHANGELOG.md b/CHANGELOG.md index 24bfe9313a..03e9b65013 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Aligns naming of sliced OpenAPI description generated by `plugin add` should be named `-openapi.json|yml` [#4595](https://github.com/microsoft/kiota/issues/4595) - Fixed RPC server to respect the `KIOTA_CONFIG_PREVIEW` flag. +- Added missing nullable directives for CLI generation. - Fixed handling of nested arrays to be handled as `UntypedNode` instances [#4549](https://github.com/microsoft/kiota/issues/4549) - Fixed `InvalidOperationException` thrown when serializing IBacked models with no changes present in the additional data in dotnet [microsoftgraph/msgraph-sdk-dotnet#2471](https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/2471). - Fixed `RequestConfiguration` Classes dropped in RequestBuilder methods in python [#4535](https://github.com/microsoft/kiota/issues/4535) diff --git a/it/csharp/dotnet.csproj b/it/csharp/dotnet.csproj index 1b7f7772d3..a34fa8ec17 100644 --- a/it/csharp/dotnet.csproj +++ b/it/csharp/dotnet.csproj @@ -9,7 +9,7 @@ - + diff --git a/it/go/go.mod b/it/go/go.mod index d45661873d..e45abed42e 100644 --- a/it/go/go.mod +++ b/it/go/go.mod @@ -6,7 +6,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 github.com/microsoft/kiota-abstractions-go v1.6.0 github.com/microsoft/kiota-authentication-azure-go v1.0.2 - github.com/microsoft/kiota-http-go v1.3.3 + github.com/microsoft/kiota-http-go v1.4.1 github.com/microsoft/kiota-serialization-form-go v1.0.0 github.com/microsoft/kiota-serialization-json-go v1.0.7 github.com/microsoft/kiota-serialization-multipart-go v1.0.0 diff --git a/it/go/go.sum b/it/go/go.sum index 7002327d9f..87169778cd 100644 --- a/it/go/go.sum +++ b/it/go/go.sum @@ -29,8 +29,8 @@ github.com/microsoft/kiota-abstractions-go v1.6.0 h1:qbGBNMU0/o5myKbikCBXJFohVCF github.com/microsoft/kiota-abstractions-go v1.6.0/go.mod h1:7YH20ZbRWXGfHSSvdHkdztzgCB9mRdtFx13+hrYIEpo= github.com/microsoft/kiota-authentication-azure-go v1.0.2 h1:tClGeyFZJ+4Bakf8u0euPM4wqy4ethycdOgx3jyH3pI= github.com/microsoft/kiota-authentication-azure-go v1.0.2/go.mod h1:aTcti0bUJEcq7kBfQG4Sr4ElvRNuaalXcFEu4iEyQ6M= -github.com/microsoft/kiota-http-go v1.3.3 h1:FKjK5BLFONu5eIBxtrkirkixFQmcPwitZ8iwZHKbESo= -github.com/microsoft/kiota-http-go v1.3.3/go.mod h1:IWw/PwtBs/GYz+Pa75gPW7MFNFv0aKPFsLw5WqzL1SE= +github.com/microsoft/kiota-http-go v1.4.1 h1:zR54JahUOcu8h9C5z00fcQChzX8d01+BwhkTS8H16Ro= +github.com/microsoft/kiota-http-go v1.4.1/go.mod h1:Kup5nMDD3a9sjdgRKHCqZWqtrv3FbprjcPaGjLR6FzM= github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjblsyVgifS11b3WCx+eFEsAI= github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA= github.com/microsoft/kiota-serialization-json-go v1.0.7 h1:yMbckSTPrjZdM4EMXgzLZSA3CtDaUBI350u0VoYRz7Y= diff --git a/it/java/pom.xml b/it/java/pom.xml index d9b1b7cc19..85cdea3afc 100644 --- a/it/java/pom.xml +++ b/it/java/pom.xml @@ -15,7 +15,7 @@ UTF-8 UTF-8 - 1.1.9 + 1.1.11 diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 0ac7bafa28..b238316d57 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -54,7 +54,7 @@ tomli==2.0.1 ; python_version < '3.11' tomli-w==1.0.0 ; python_version >= '3.7' -tomlkit==0.12.4 ; python_version >= '3.7' +tomlkit==0.12.5 ; python_version >= '3.7' typing-extensions==4.11.0 ; python_version >= '3.7' diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index a458a8769e..1f9b275db1 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -22,10 +22,10 @@ }, "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", - "@types/node": "^20.12.10", + "@types/node": "^20.12.11", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.8.0", - "esbuild": "^0.21.0", + "esbuild": "^0.21.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "minimist": "^1.2.8", @@ -221,9 +221,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.0.tgz", - "integrity": "sha512-kB8I77Onff4y6hAREwsjF11ifM+xi8bBIq/viMO5NFZDX2vKlF0/mevHJYb4sNfb55jIREeUztkUfIgOFtSzdw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", + "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", "cpu": [ "ppc64" ], @@ -237,9 +237,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.0.tgz", - "integrity": "sha512-8OvDALSbmoLJ79KCs0hxoki5I3qJA7JQMhJO6aq5O8G+pi7TPnGICdQRQcgdzwZaVc4ptp5SX7Phg6jKzvSEBg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", + "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", "cpu": [ "arm" ], @@ -253,9 +253,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.0.tgz", - "integrity": "sha512-SDGbrIOL6P6WTIbDcCa2sbFgznp8o6ztjGWrA+js8JZ9HhBXavN3gPrEqUqB4+bV4AdsqlZG1tK2F06BOPNpZg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", + "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", "cpu": [ "arm64" ], @@ -269,9 +269,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.0.tgz", - "integrity": "sha512-G4fkcHqDtIbiE9b3KFJP+ay+TiCOHmenT5GYVi0fuHxFbX0CJ3lpTQbFuWR5s5AlYZZ1j4yY2hbggSUkaBK0pg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", + "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", "cpu": [ "x64" ], @@ -285,9 +285,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.0.tgz", - "integrity": "sha512-XMcLA6siz67AoEOl8WOot2Y3TOSClT15AqJdQz/sx98Dpv3oTbcv0BoqvHAhpBPgC8iyIKM98vVj6th7lA4DFg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", + "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", "cpu": [ "arm64" ], @@ -301,9 +301,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.0.tgz", - "integrity": "sha512-+dmvTVqVkAArjJyIbo4Rl2S4I4A/yRuivTPR9Igw0QMBVSJegJqixKxZvKLCh8xi6n8tePdq3EpfbFYH2KNNiw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", + "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", "cpu": [ "x64" ], @@ -317,9 +317,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.0.tgz", - "integrity": "sha512-g8/wBRLbsjryMBo4PGg050I1fn4qrJobkxpT1OekO6I4H2HVQfVfBAvGPhwzc9tr8CUVu0pSGSz9oDPGIjhLNw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", + "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", "cpu": [ "arm64" ], @@ -333,9 +333,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.0.tgz", - "integrity": "sha512-uwRL7kSN9tfFBpa7o9HQjEgxPsQsSmOz2ALQ30dxMNT22xS49s8nUtFi7bJ+kM/pcTHcnhyJwJPCY7cwlbQbWQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", + "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", "cpu": [ "x64" ], @@ -349,9 +349,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.0.tgz", - "integrity": "sha512-8s/YeLaUV3QTaGzwDqiTpb78Nw/DdIaUdIlRZItGgWf/8UZHsYUIWj9RfsEXVJB5qvtrg835Dgz/gf+GmFGa7w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", + "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", "cpu": [ "arm" ], @@ -365,9 +365,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.0.tgz", - "integrity": "sha512-mgOuJBbV8Uexb3BmeVl1q2preJMu0aDiwiFxIfsQhE2+rqxVAEcIrllb7SulkH9G244O/ZN1VVILdZb2NPSvpw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", + "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", "cpu": [ "arm64" ], @@ -381,9 +381,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.0.tgz", - "integrity": "sha512-7pVhVYBt3/R8x0Um9p4V8eMiQcnk6/IHkOo6tkfLnDqPn+NS6lnbfWysAYeDAqFKt6INQKtVxejh6ccbVYLBwQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", + "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", "cpu": [ "ia32" ], @@ -397,9 +397,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.0.tgz", - "integrity": "sha512-P8Lse7CXV83ARWVaq6KwV6w86ABeViyUvw6s++tYsUuqUEZgG5697Un72usafkuD7AfOyBdFX6JqZSvIQAU0yQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", + "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", "cpu": [ "loong64" ], @@ -413,9 +413,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.0.tgz", - "integrity": "sha512-lUvMkXlUMrx5vnspMWohma6vuWh+Z/mPV6DdbXW07fNgF2Tlg6SLSqqzDXv5XYV4og5awNFYcPXpgqOVsqdx7Q==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", + "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", "cpu": [ "mips64el" ], @@ -429,9 +429,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.0.tgz", - "integrity": "sha512-wLi9VRnLDRg1Gudic24gcT5aa5LZGBwLi4aYghQ9bVb8z0qYHrZnRTNxulErFvOsSgijUWS5uNLCUaLwj+tvIQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", + "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", "cpu": [ "ppc64" ], @@ -445,9 +445,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.0.tgz", - "integrity": "sha512-MOjonqpNtns0Y32NwvMZiZXw94g8EqeqI+4BQtIHj07xX61vOyqlBsJH3UbjkWvaewie1VP9IoiX2Ja/P2XCJw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", + "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", "cpu": [ "riscv64" ], @@ -461,9 +461,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.0.tgz", - "integrity": "sha512-Gz/gafubuM3L1D29LnqaxcGg16aa2XES/uFTFdcvrwsRpMxkLiowaUvIiWJfatf/oCyyZu5CT8SrlMy37dGc7A==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", + "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", "cpu": [ "s390x" ], @@ -477,9 +477,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.0.tgz", - "integrity": "sha512-OGorpObKLm8XlhoJlxtdwECfnESXu3kd8mU1yZ5Xk0vmh0d2xoJjEXJi7y7mjFpc3+XfGQRgHq/gqyIkbufnvA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", + "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", "cpu": [ "x64" ], @@ -493,9 +493,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.0.tgz", - "integrity": "sha512-AwkJoff9D5Px7+lHafSSgDK3JreyeyPtwTsOfxhlk5NZ+bMGlvSfHkA6DKv9vD0gmGrBPTMv/uIePkNaVsDq7w==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", + "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", "cpu": [ "x64" ], @@ -509,9 +509,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.0.tgz", - "integrity": "sha512-wqv7KSmRA4qf0lFZ2Abjp2boO9tDe7YwNLZ7DNUI5rsluS0/TF78CtPUUAePukgE6b2HcXYZYuL5F2yXdQIqIg==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", + "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", "cpu": [ "x64" ], @@ -525,9 +525,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.0.tgz", - "integrity": "sha512-3qAZFC752nZZQOI+OG4KIawvLfdD5yMFCeIFz0OhedMpYgq9AOKygW45Ojy0E5upBqns2fUaMFk1CnNSkvJaYw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", + "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", "cpu": [ "x64" ], @@ -541,9 +541,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.0.tgz", - "integrity": "sha512-06BY4wjQQ2bPjayuvKWXr5X3V+ZGnoTOX1+doLoQBUSyCDb9JZgX7o0N3t3rRNmEiMY/DuxXwu+EE+U32B4ErA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", + "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", "cpu": [ "arm64" ], @@ -557,9 +557,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.0.tgz", - "integrity": "sha512-uTLz9mPOMkl3bfuGnSQumrUN7U1aPb8MCOdjQJOWPGdXTZhkK6Z2lLHxdTjX6C51jxXWWAo64tcRwiAYOkQhJw==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", + "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", "cpu": [ "ia32" ], @@ -573,9 +573,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.0.tgz", - "integrity": "sha512-XT0oCVNRjmrMTz/Xd+9L2eOI83gUQZg9Viiv3cuT/8VNlXVMn6QsxyBMDNFsYX+wmQRD31VMKNtkZaXvS3/JiA==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", + "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", "cpu": [ "x64" ], @@ -827,9 +827,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.10.tgz", - "integrity": "sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw==", + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1606,9 +1606,9 @@ } }, "node_modules/esbuild": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.0.tgz", - "integrity": "sha512-eyK64lASNug3Wo2+bQEBnYngjh9rkXUfOus403+OeVZteMon6moIhcEYbrSvcgBN6RsrRWCMoWcKDDK6UEsTOQ==", + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", + "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", "dev": true, "hasInstallScript": true, "bin": { @@ -1618,29 +1618,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.0", - "@esbuild/android-arm": "0.21.0", - "@esbuild/android-arm64": "0.21.0", - "@esbuild/android-x64": "0.21.0", - "@esbuild/darwin-arm64": "0.21.0", - "@esbuild/darwin-x64": "0.21.0", - "@esbuild/freebsd-arm64": "0.21.0", - "@esbuild/freebsd-x64": "0.21.0", - "@esbuild/linux-arm": "0.21.0", - "@esbuild/linux-arm64": "0.21.0", - "@esbuild/linux-ia32": "0.21.0", - "@esbuild/linux-loong64": "0.21.0", - "@esbuild/linux-mips64el": "0.21.0", - "@esbuild/linux-ppc64": "0.21.0", - "@esbuild/linux-riscv64": "0.21.0", - "@esbuild/linux-s390x": "0.21.0", - "@esbuild/linux-x64": "0.21.0", - "@esbuild/netbsd-x64": "0.21.0", - "@esbuild/openbsd-x64": "0.21.0", - "@esbuild/sunos-x64": "0.21.0", - "@esbuild/win32-arm64": "0.21.0", - "@esbuild/win32-ia32": "0.21.0", - "@esbuild/win32-x64": "0.21.0" + "@esbuild/aix-ppc64": "0.21.2", + "@esbuild/android-arm": "0.21.2", + "@esbuild/android-arm64": "0.21.2", + "@esbuild/android-x64": "0.21.2", + "@esbuild/darwin-arm64": "0.21.2", + "@esbuild/darwin-x64": "0.21.2", + "@esbuild/freebsd-arm64": "0.21.2", + "@esbuild/freebsd-x64": "0.21.2", + "@esbuild/linux-arm": "0.21.2", + "@esbuild/linux-arm64": "0.21.2", + "@esbuild/linux-ia32": "0.21.2", + "@esbuild/linux-loong64": "0.21.2", + "@esbuild/linux-mips64el": "0.21.2", + "@esbuild/linux-ppc64": "0.21.2", + "@esbuild/linux-riscv64": "0.21.2", + "@esbuild/linux-s390x": "0.21.2", + "@esbuild/linux-x64": "0.21.2", + "@esbuild/netbsd-x64": "0.21.2", + "@esbuild/openbsd-x64": "0.21.2", + "@esbuild/sunos-x64": "0.21.2", + "@esbuild/win32-arm64": "0.21.2", + "@esbuild/win32-ia32": "0.21.2", + "@esbuild/win32-x64": "0.21.2" } }, "node_modules/escape-html": { diff --git a/it/typescript/package.json b/it/typescript/package.json index 7b2f0efb6a..f7371eeabe 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -19,10 +19,10 @@ "prettier": "./.prettierrc.json", "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", - "@types/node": "^20.12.10", + "@types/node": "^20.12.11", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.8.0", - "esbuild": "^0.21.0", + "esbuild": "^0.21.2", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "minimist": "^1.2.8", diff --git a/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs b/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs index b651471c26..ebec472968 100644 --- a/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs @@ -341,7 +341,9 @@ private void WriteCommandHandlerBodyOutput(LanguageWriter writer, in CodeMethod if (originalMethod.PagingInformation != null) { + writer.WriteLine(CSharpConventionService.NullableEnableDirective, false); writer.WriteLine($"IOutputFormatter? {formatterVar} = null;"); + writer.WriteLine(CSharpConventionService.NullableRestoreDirective, false); } if (originalMethod.ReturnType is CodeType type && conventions.GetTypeString(type, originalMethod) is { } typeString && !typeString.Equals("Stream", StringComparison.Ordinal)) diff --git a/src/Kiota.Builder/Writers/CSharp/CSharpConventionService.cs b/src/Kiota.Builder/Writers/CSharp/CSharpConventionService.cs index 62e01592b3..5a5c1309e8 100644 --- a/src/Kiota.Builder/Writers/CSharp/CSharpConventionService.cs +++ b/src/Kiota.Builder/Writers/CSharp/CSharpConventionService.cs @@ -18,17 +18,19 @@ public class CSharpConventionService : CommonLanguageConventionService public const char NullableMarker = '?'; public static string NullableMarkerAsString => "?"; public override string ParseNodeInterfaceName => "IParseNode"; + public const string NullableEnableDirective = "#nullable enable"; + public const string NullableRestoreDirective = "#nullable restore"; public static void WriteNullableOpening(LanguageWriter writer) { ArgumentNullException.ThrowIfNull(writer); writer.WriteLine($"#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER", false); - writer.WriteLine($"#nullable enable", false); + writer.WriteLine(NullableEnableDirective, false); } public static void WriteNullableMiddle(LanguageWriter writer) { ArgumentNullException.ThrowIfNull(writer); - writer.WriteLine($"#nullable restore", false); + writer.WriteLine(NullableRestoreDirective, false); writer.WriteLine("#else", false); } public static void WriteNullableClosing(LanguageWriter writer) diff --git a/tests/Kiota.Builder.Tests/Writers/CLI/CliCodeMethodWriterTests.cs b/tests/Kiota.Builder.Tests/Writers/CLI/CliCodeMethodWriterTests.cs index c211a7121c..ab5d455c24 100644 --- a/tests/Kiota.Builder.Tests/Writers/CLI/CliCodeMethodWriterTests.cs +++ b/tests/Kiota.Builder.Tests/Writers/CLI/CliCodeMethodWriterTests.cs @@ -951,7 +951,9 @@ public void WritesExecutableCommandForPagedGetRequestModel() Assert.Contains("var pagingData = new PageLinkData(requestInfo, null, itemName: \"item\", nextLinkName: \"nextLink\");", result); Assert.Contains("var reqAdapter = invocationContext.GetRequestAdapter()", result); Assert.Contains("var pageResponse = await pagingService.GetPagedDataAsync((info, token) => reqAdapter.SendNoContentAsync(info, cancellationToken: token), pagingData, all, cancellationToken);", result); + Assert.Contains("#nullable enable", result); Assert.Contains("IOutputFormatter? formatter = null;", result); + Assert.Contains("#nullable restore", result); Assert.Contains("if (pageResponse?.StatusCode >= 200 && pageResponse?.StatusCode < 300) {", result); Assert.Contains("formatter = outputFormatterFactory.GetFormatter(output);", result); Assert.Contains("response = (response != Stream.Null) ? await outputFilter.FilterOutputAsync(response, query, cancellationToken) : response", result); diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 3003fc4576..d9638f2a6f 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -24,7 +24,7 @@ "@typescript-eslint/parser": "^7.5.0", "@vscode/test-electron": "^2.3.9", "eslint": "^8.57.0", - "glob": "^10.3.12", + "glob": "^10.3.15", "mocha": "^10.4.0", "ts-loader": "^9.5.1", "typescript": "^5.4.5", @@ -492,9 +492,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.10.tgz", - "integrity": "sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw==", + "version": "20.12.11", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.11.tgz", + "integrity": "sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -2059,22 +2059,22 @@ } }, "node_modules/glob": { - "version": "10.3.12", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", - "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", + "version": "10.3.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz", + "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^2.3.6", "minimatch": "^9.0.1", "minipass": "^7.0.4", - "path-scurry": "^1.10.2" + "path-scurry": "^1.11.0" }, "bin": { "glob": "dist/esm/bin.mjs" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -2715,9 +2715,9 @@ } }, "node_modules/lru-cache": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", - "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", + "version": "10.2.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", "dev": true, "engines": { "node": "14 || >=16.14" @@ -2796,9 +2796,9 @@ } }, "node_modules/minipass": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", - "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz", + "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==", "dev": true, "engines": { "node": ">=16 || 14 >=14.17" @@ -3115,9 +3115,9 @@ "dev": true }, "node_modules/path-scurry": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", - "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.0.tgz", + "integrity": "sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==", "dev": true, "dependencies": { "lru-cache": "^10.2.0", diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index baf1fdd9a7..c3354cdc99 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -431,7 +431,7 @@ "@typescript-eslint/parser": "^7.5.0", "@vscode/test-electron": "^2.3.9", "eslint": "^8.57.0", - "glob": "^10.3.12", + "glob": "^10.3.15", "mocha": "^10.4.0", "ts-loader": "^9.5.1", "typescript": "^5.4.5",