From 101cfab3c637cf0c1fb35e1e6c5f43ec607e69c2 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:01:18 -0500 Subject: [PATCH 01/52] ci: aligns v1 ci with latest main changes Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 103 ++++++++++++++---- .../OpenAPI.NET.OData-branch-protection.yml | 82 ++++++++++++++ .github/workflows/codeql-analysis.yml | 4 +- .github/workflows/sonarcloud.yml | 5 +- .gitignore | 2 +- .vscode/settings.json | 3 +- README.md | 8 +- src/OoasUtil/README.md | 2 +- tool/PoliCheck/RunPoliCheck.ps1 | 2 +- 9 files changed, 179 insertions(+), 32 deletions(-) create mode 100644 .github/policies/OpenAPI.NET.OData-branch-protection.yml diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index d0823cf66..ee410f158 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -6,11 +6,13 @@ name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) trigger: branches: include: - - master + - main + - support/v1 pr: branches: include: - - master + - main + - support/v1 variables: buildPlatform: 'Any CPU' @@ -60,10 +62,10 @@ extends: version: 8.x # Install the nuget tool. - - task: NuGetToolInstaller@0 - displayName: 'Use NuGet >=5.2.0' + - task: NuGetToolInstaller@1 + displayName: 'Use NuGet >=6.11.0' inputs: - versionSpec: '>=5.2.0' + versionSpec: '>=6.11.0' checkLatest: true # Build the Product project @@ -81,11 +83,16 @@ extends: projects: '$(Build.SourcesDirectory)\Microsoft.OpenApi.OData.sln' arguments: '--configuration $(BuildConfiguration) --no-build' - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3 + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 displayName: 'ESRP CodeSigning' inputs: - ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' - FolderPath: src + ConnectedServiceName: 'Federated DevX ESRP Managed Identity Connection' + FolderPath: 'src' + AppRegistrationClientId: '65035b7f-7357-4f29-bf25-c5ee5c3949f8' + AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2' + AuthAKVName: 'akv-prod-eastus' + AuthCertName: 'ReferenceLibraryPrivateCert' + AuthSignCertName: 'ReferencePackagePublisherCertificate' signConfigType: inlineSignParams inlineOperation: | [ @@ -125,7 +132,10 @@ extends: "toolVersion": "1.0" } ] - SessionTimeout: 20 + SessionTimeout: '20' + MaxConcurrency: '50' + MaxRetryAttempts: '5' + PendingAnalysisWaitTimeoutMinutes: '5' # Pack - task: DotNetCoreCLI@2 @@ -137,17 +147,22 @@ extends: - task: PowerShell@2 displayName: 'Validate project version has been incremented' - condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) + condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded()) inputs: targetType: 'filePath' filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 pwsh: true - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3 + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 displayName: 'ESRP CodeSigning Nuget Packages' inputs: - ConnectedServiceName: 'microsoftgraph ESRP CodeSign DLL and NuGet (AKV)' + ConnectedServiceName: 'Federated DevX ESRP Managed Identity Connection' FolderPath: '$(Build.ArtifactStagingDirectory)' + AppRegistrationClientId: '65035b7f-7357-4f29-bf25-c5ee5c3949f8' + AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2' + AuthAKVName: 'akv-prod-eastus' + AuthCertName: 'ReferenceLibraryPrivateCert' + AuthSignCertName: 'ReferencePackagePublisherCertificate' Pattern: '*.nupkg' signConfigType: inlineSignParams inlineOperation: | @@ -167,13 +182,23 @@ extends: "toolVersion": "1.0" } ] - SessionTimeout: 20 + SessionTimeout: '60' + MaxConcurrency: '50' + MaxRetryAttempts: '5' + PendingAnalysisWaitTimeoutMinutes: '5' - stage: deploy - condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded()) + condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded()) dependsOn: build jobs: - deployment: deploy + templateContext: + type: releaseJob + isProduction: true + inputs: + - input: pipelineArtifact + artifactName: Nugets + targetPath: '$(Pipeline.Workspace)' environment: nuget-org strategy: runOnce: @@ -181,16 +206,54 @@ extends: pool: vmImage: ubuntu-latest steps: - - task: DownloadPipelineArtifact@2 - displayName: Download nupkg from artifacts - inputs: - artifact: Nugets - source: current - task: 1ES.PublishNuget@1 displayName: 'NuGet push' inputs: - packagesToPush: '$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.OData.*.nupkg' + packagesToPush: '$(Pipeline.Workspace)/Microsoft.OpenApi.OData.*.nupkg' nuGetFeedType: external publishFeedCredentials: 'OpenAPI Nuget Connection' packageParentPath: '$(Pipeline.Workspace)' + + - deployment: create_github_release + templateContext: + type: releaseJob + isProduction: true + inputs: + - input: pipelineArtifact + artifactName: Nugets + targetPath: '$(Pipeline.Workspace)' + dependsOn: [] + environment: kiota-github-releases + strategy: + runOnce: + deploy: + pool: + vmImage: ubuntu-latest + steps: + - pwsh: | + $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1 + $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData", "" -replace ".nupkg", "" + #Set Variable $artifactName and $artifactVersion + Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion" + echo "$artifactVersion" + displayName: 'Fetch Artifact Name' + - task: GitHubRelease@1 + displayName: 'GitHub release' + condition: succeededOrFailed() + inputs: + gitHubConnection: 'Github-MaggieKimani1' + action: create + tagSource: userSpecifiedTag + tag: 'v$(artifactVersion)' + title: 'v$(artifactVersion)' + releaseNotesSource: inline + assets: '$(Pipeline.Workspace)\**\*.nupkg' + changeLogType: issueBased + changeLogLabels: '[ + { "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" }, + { "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" }, + { "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" }, + { "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"}, + { "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" } + ]' diff --git a/.github/policies/OpenAPI.NET.OData-branch-protection.yml b/.github/policies/OpenAPI.NET.OData-branch-protection.yml new file mode 100644 index 000000000..7a91aec7e --- /dev/null +++ b/.github/policies/OpenAPI.NET.OData-branch-protection.yml @@ -0,0 +1,82 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +# File initially created using https://github.com/MIchaelMainer/policyservicetoolkit/blob/main/branch_protection_export.ps1. + +name: OpenAPI.NET.OData-branch-protection +description: Branch protection policy for the OpenAPI.NET.OData repository +resource: repository +configuration: + branchProtectionRules: + + - branchNamePattern: main + # This branch pattern applies to the following branches as of 06/09/2024 20:45:44: + # main + + # Specifies whether this branch can be deleted. boolean + allowsDeletions: false + # Specifies whether forced pushes are allowed on this branch. boolean + allowsForcePushes: false + # Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean + dismissStaleReviews: true + # Specifies whether admins can overwrite branch protection. boolean + isAdminEnforced: false + # Indicates whether "Require a pull request before merging" is enabled. boolean + requiresPullRequestBeforeMerging: true + # Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required + requiredApprovingReviewsCount: 1 + # Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean + requireCodeOwnersReview: true + # Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines. + requiresCommitSignatures: false + # Are conversations required to be resolved before merging? boolean + requiresConversationResolution: true + # Are merge commits prohibited from being pushed to this branch. boolean + requiresLinearHistory: false + # Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status + requiredStatusChecks: + - license/cla + - Continuous Integration + - CodeQL + # Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean + requiresStrictStatusChecks: false + # Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush. + restrictsPushes: false + # Restrict who can dismiss pull request reviews. boolean + restrictsReviewDismissals: false + + - branchNamePattern: support/v1 + # This branch pattern applies to the following branches as of 06/09/2024 20:45:44: + # support/v1 + + # Specifies whether this branch can be deleted. boolean + allowsDeletions: false + # Specifies whether forced pushes are allowed on this branch. boolean + allowsForcePushes: false + # Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean + dismissStaleReviews: true + # Specifies whether admins can overwrite branch protection. boolean + isAdminEnforced: false + # Indicates whether "Require a pull request before merging" is enabled. boolean + requiresPullRequestBeforeMerging: true + # Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required + requiredApprovingReviewsCount: 1 + # Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean + requireCodeOwnersReview: true + # Are commits required to be signed. boolean. TODO: all contributors must have commit signing on local machines. + requiresCommitSignatures: false + # Are conversations required to be resolved before merging? boolean + requiresConversationResolution: true + # Are merge commits prohibited from being pushed to this branch. boolean + requiresLinearHistory: false + # Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status + requiredStatusChecks: + - license/cla + - Continuous Integration + - CodeQL + # Require branches to be up to date before merging. This should be false since the repo contains autogenerated files. boolean + requiresStrictStatusChecks: false + # Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush. + restrictsPushes: false + # Restrict who can dismiss pull request reviews. boolean + restrictsReviewDismissals: false \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index cd365f878..56409ee78 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [ main, support/v1 ] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [ main, support/v1 ] schedule: - cron: '32 2 * * 6' workflow_dispatch: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 028b4e037..567536c5f 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - support/v1 paths-ignore: ['.vscode/**'] pull_request: types: [opened, synchronize, reopened] @@ -60,8 +61,8 @@ jobs: CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682 shell: pwsh run: | - dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET.OData" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.net7.0.opencover.xml" + dotnet tool run dotnet-sonarscanner begin /k:"microsoft_OpenAPI.NET.OData" /o:"microsoft" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="test/**/coverage.net8.0.opencover.xml" dotnet workload restore dotnet build dotnet test Microsoft.OpenApi.OData.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover - dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file + dotnet tool run dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" diff --git a/.gitignore b/.gitignore index 940794e60..4caae17f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore # User-specific files *.suo diff --git a/.vscode/settings.json b/.vscode/settings.json index 9cc75cead..9893070db 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,6 @@ "MD025": { "front_matter_title": "" } - } + }, + "azure-pipelines.1ESPipelineTemplatesSchemaFile": true } \ No newline at end of file diff --git a/README.md b/README.md index 575d609e0..b02123072 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,15 @@ The **Microsoft.OpenAPI.OData.Reader** library helps represent an OData service The conversion is based on the mapping doc from [OASIS OData OpenAPI v1.0](https://www.oasis-open.org/committees/document.php?document_id=61852&wg_abbrev=odata) and uses the following : -1. [Capabilities vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Capabilities.V1.xml) -2. [Authorization vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Authorization.V1.xml) -3. [Core vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/master/vocabularies/Org.OData.Core.V1.xml) +1. [Capabilities vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Capabilities.V1.xml) +2. [Authorization vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Authorization.V1.xml) +3. [Core vocabulary annotation](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.xml) 4. Navigation property path 5. Edm operation and operation import path ## Overview -The image below is generic overview of how this library can convert the EDM model to an [OpenAPI.NET document](https://github.com/Microsoft/OpenAPI.NET/blob/master/src/Microsoft.OpenApi/Models/OpenApiDocument.cs) object. +The image below is generic overview of how this library can convert the EDM model to an [OpenAPI.NET document](https://github.com/Microsoft/OpenAPI.NET/blob/main/src/Microsoft.OpenApi/Models/OpenApiDocument.cs) object. ![Convert OData CSDL to OpenAPI](docs/images/odata-2-openapi.png "Map /// OData CSDL --> OpenAPI.NET") diff --git a/src/OoasUtil/README.md b/src/OoasUtil/README.md index 2eaa7a6d4..95435d412 100644 --- a/src/OoasUtil/README.md +++ b/src/OoasUtil/README.md @@ -70,7 +70,7 @@ Indicate to output file name. `OoasUtil.exe -j -k -drs -drq -p -u -s 3 -i http://services.odata.org/TrippinRESTierService -o trip.json` -The content of `trip.json` is similar at https://github.com/xuzhg/OData.OpenAPI/blob/master/Microsoft.OData.OpenAPI/Microsoft.OData.OpenAPI.Tests/Resources/TripService.OpenApi.json +The content of `trip.json` is similar at https://github.com/xuzhg/OData.OpenAPI/blob/main/Microsoft.OData.OpenAPI/Microsoft.OData.OpenAPI.Tests/Resources/TripService.OpenApi.json # Alternative Tool - Hidi diff --git a/tool/PoliCheck/RunPoliCheck.ps1 b/tool/PoliCheck/RunPoliCheck.ps1 index 92bb179d1..3eb663fbd 100644 --- a/tool/PoliCheck/RunPoliCheck.ps1 +++ b/tool/PoliCheck/RunPoliCheck.ps1 @@ -10,7 +10,7 @@ param( #Example: # RunPoliCheck.ps1 -BuildSourceDir "C:\BuildAgent\_work\32\s" # -folderName "src" -# -branchName "odata.net-master" +# -branchName "odata.net-main" # -resultRoot "C:\Users\ODatabld\Documents\PoliCheck\LatestRunResult" # -PoliCheckPath "C:\Program Files (x86)\Microsoft\PoliCheck\" # From 6897ff4ba525cf2f3bd659eed035a4fb15e09b6e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:04:48 -0500 Subject: [PATCH 02/52] chore: updates oai.net reference --- .../Microsoft.OpenAPI.OData.Reader.csproj | 2 +- src/OoasGui/OoasGui.csproj | 2 +- .../Microsoft.OpenAPI.OData.Reader.Tests.csproj | 2 +- tool/UpdateDocs/UpdateDocs.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index bb5af0b30..3897c3124 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -42,7 +42,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/OoasGui/OoasGui.csproj b/src/OoasGui/OoasGui.csproj index 41fee3ca1..e055c4fdb 100644 --- a/src/OoasGui/OoasGui.csproj +++ b/src/OoasGui/OoasGui.csproj @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj index 0987324f1..440b3bef3 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj @@ -73,7 +73,7 @@ all - + all diff --git a/tool/UpdateDocs/UpdateDocs.csproj b/tool/UpdateDocs/UpdateDocs.csproj index 7ebbd6d97..f1139f651 100644 --- a/tool/UpdateDocs/UpdateDocs.csproj +++ b/tool/UpdateDocs/UpdateDocs.csproj @@ -13,6 +13,6 @@ - + \ No newline at end of file From 70a733f9122d4898ab28d1c6ab4c955838d81da9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 09:34:13 -0500 Subject: [PATCH 03/52] fix: target OAS versions --- docs/oas3_0_0/TripService.json | 2 +- docs/oas3_0_0/graph.beta.json | 2 +- docs/oas3_0_0/graph1.0.json | 2 +- docs/oas3_0_0/graph1.0_updated.json | 2 +- docs/oas3_0_0/graph1.0_withSecurity.json | 2 +- .../Resources/Basic.OpenApi.json | 2 +- .../Resources/Basic.OpenApi.yaml | 2 +- .../Resources/Empty.OpenApi.json | 2 +- .../Resources/Empty.OpenApi.yaml | 2 +- .../Resources/Multiple.Schema.OpenApi.json | 2 +- .../Resources/Multiple.Schema.OpenApi.yaml | 2 +- .../Resources/TripService.OpenApi.json | 2 +- .../Resources/TripService.OpenApi.yaml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/oas3_0_0/TripService.json b/docs/oas3_0_0/TripService.json index d16a2df8c..c9f2082a3 100644 --- a/docs/oas3_0_0/TripService.json +++ b/docs/oas3_0_0/TripService.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models", "description": "This OData service is located at http://localhost", diff --git a/docs/oas3_0_0/graph.beta.json b/docs/oas3_0_0/graph.beta.json index e16fa9661..9e20d18e2 100644 --- a/docs/oas3_0_0/graph.beta.json +++ b/docs/oas3_0_0/graph.beta.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace microsoft.graph", "description": "This OData service is located at https://graph.microsoft.com/beta", diff --git a/docs/oas3_0_0/graph1.0.json b/docs/oas3_0_0/graph1.0.json index 0c0008df6..dee21ce7b 100644 --- a/docs/oas3_0_0/graph1.0.json +++ b/docs/oas3_0_0/graph1.0.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace microsoft.graph", "description": "This OData service is located at https://graph.microsoft.com/v1.0", diff --git a/docs/oas3_0_0/graph1.0_updated.json b/docs/oas3_0_0/graph1.0_updated.json index 0c0008df6..dee21ce7b 100644 --- a/docs/oas3_0_0/graph1.0_updated.json +++ b/docs/oas3_0_0/graph1.0_updated.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace microsoft.graph", "description": "This OData service is located at https://graph.microsoft.com/v1.0", diff --git a/docs/oas3_0_0/graph1.0_withSecurity.json b/docs/oas3_0_0/graph1.0_withSecurity.json index 9b8f96dd6..e8c26bb42 100644 --- a/docs/oas3_0_0/graph1.0_withSecurity.json +++ b/docs/oas3_0_0/graph1.0_withSecurity.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace microsoft.graph", "description": "This OData service is located at https://graph.microsoft.com/v1.0", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json index c2e137ea3..6a1b83ca8 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace DefaultNs", "description": "This OData service is located at http://localhost", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml index 81208bcf3..408cd572c 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.4 info: title: OData Service for namespace DefaultNs description: This OData service is located at http://localhost diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json index 6ed119565..463e153e6 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace ", "description": "This OData service is located at http://localhost", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml index 9d7906317..db82e6a53 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.4 info: title: 'OData Service for namespace ' description: This OData service is located at http://localhost diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index bb39c0824..35f3f7e30 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace Default", "description": "This OData service is located at http://localhost", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index aa66b9c73..22f1882e1 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.4 info: title: OData Service for namespace Default description: This OData service is located at http://localhost diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 7f4abd96f..d89fdd911 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models", "description": "This OData service is located at http://services.odata.org/TrippinRESTierService", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 366f65b51..25510e863 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.4 info: title: OData Service for namespace Microsoft.OData.Service.Sample.TrippinInMemory.Models description: This OData service is located at http://services.odata.org/TrippinRESTierService From a3ae7dbe029f06cf79591f61b2cfcbe5487b6e97 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:06:29 -0500 Subject: [PATCH 04/52] chore: updates testing dependencies --- .../Microsoft.OpenAPI.OData.Reader.Tests.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj index 440b3bef3..ab6fb89f8 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Microsoft.OpenAPI.OData.Reader.Tests.csproj @@ -72,10 +72,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive From 52526da76912bd52b02348bd85fa79cfa2b590c0 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:07:51 -0500 Subject: [PATCH 05/52] chore: updates edm dependencies --- .../Microsoft.OpenAPI.OData.Reader.csproj | 2 +- src/OoasGui/OoasGui.csproj | 2 +- tool/UpdateDocs/UpdateDocs.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 3897c3124..f263ab003 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -41,7 +41,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/OoasGui/OoasGui.csproj b/src/OoasGui/OoasGui.csproj index e055c4fdb..1b3159847 100644 --- a/src/OoasGui/OoasGui.csproj +++ b/src/OoasGui/OoasGui.csproj @@ -16,7 +16,7 @@ - + diff --git a/tool/UpdateDocs/UpdateDocs.csproj b/tool/UpdateDocs/UpdateDocs.csproj index f1139f651..b9139117d 100644 --- a/tool/UpdateDocs/UpdateDocs.csproj +++ b/tool/UpdateDocs/UpdateDocs.csproj @@ -12,7 +12,7 @@ - + \ No newline at end of file From 37a05b81e4dc9f2cc2ddbc5c1e4923d148c1e599 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:10:58 -0500 Subject: [PATCH 06/52] chore: bumps version --- .../Microsoft.OpenAPI.OData.Reader.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index f263ab003..8d138498f 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,7 +15,7 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.6.8 + 1.6.9 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM From bddfa6428cdfbcd5ab4183ede2a5ecc979834028 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:12:56 -0500 Subject: [PATCH 07/52] chore: reflects latest code owner changes --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 59abe62bd..912000f61 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @xuzhg @irvinesunday @darrelmiller @zengin @coseguera @millicentachieng @andrueastman +* @xuzhg @irvinesunday @darrelmiller @danielmbaluka @gavinbarron @millicentachieng @andrueastman @baywet From e80e3b8d845e7e80d52b6827d2a60f66fcababbd Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Mon, 30 Sep 2024 12:42:21 +0300 Subject: [PATCH 08/52] Update operation tags generation --- .../Operation/EdmOperationOperationHandler.cs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 72ebb2258..6e8c6926e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -133,10 +133,12 @@ protected override void SetBasicInfo(OpenApiOperation operation) /// protected override void SetTags(OpenApiOperation operation) { - string value = EdmOperation.IsAction() ? "Actions" : "Functions"; + string tagName = null; + var secondLastSegment = Path.Segments.Reverse().Skip(1).First(); + GenerateTagName(secondLastSegment, out tagName); OpenApiTag tag = new OpenApiTag { - Name = NavigationSource.Name + "." + value, + Name = tagName, }; tag.Extensions.Add(Constants.xMsTocType, new OpenApiString("container")); operation.Tags.Add(tag); @@ -146,6 +148,23 @@ protected override void SetTags(OpenApiOperation operation) base.SetTags(operation); } + private void GenerateTagName(ODataSegment targetSegment, out string tagName) + { + if (targetSegment is ODataNavigationPropertySegment) + { + tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context); + } + else if (targetSegment is ODataOperationSegment || targetSegment is ODataOperationImportSegment) + { // Composable function + targetSegment = Path.Segments.Reverse().Skip(2).First(); + GenerateTagName(targetSegment, out tagName); + } + else // ODataKeySegment or ODataNavigationSourceSegment + { + tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + } + } + /// protected override void SetParameters(OpenApiOperation operation) { From 022ebeec951b7ea1efcd6ffd51e8b0f9a4bbbca9 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Mon, 30 Sep 2024 15:25:54 +0300 Subject: [PATCH 09/52] Refactor operation tag generation --- .../Operation/EdmOperationOperationHandler.cs | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 6e8c6926e..cbb31909b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -132,11 +132,9 @@ protected override void SetBasicInfo(OpenApiOperation operation) /// protected override void SetTags(OpenApiOperation operation) - { - string tagName = null; - var secondLastSegment = Path.Segments.Reverse().Skip(1).First(); - GenerateTagName(secondLastSegment, out tagName); - OpenApiTag tag = new OpenApiTag + { + GenerateTagName(out string tagName); + OpenApiTag tag = new() { Name = tagName, }; @@ -148,18 +146,26 @@ protected override void SetTags(OpenApiOperation operation) base.SetTags(operation); } - private void GenerateTagName(ODataSegment targetSegment, out string tagName) - { + /// + /// Genrates the tag name for the operation. + /// + /// The generated tag name. + /// The number of segments to skip. + private void GenerateTagName(out string tagName, int skip = 1) + { + var targetSegment = Path.Segments.Reverse().Skip(skip).First(); + if (targetSegment is ODataNavigationPropertySegment) { tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context); } - else if (targetSegment is ODataOperationSegment || targetSegment is ODataOperationImportSegment) - { // Composable function - targetSegment = Path.Segments.Reverse().Skip(2).First(); - GenerateTagName(targetSegment, out tagName); + else if (targetSegment is ODataOperationSegment || targetSegment is ODataOperationImportSegment // Composable function + || targetSegment is ODataKeySegment) // Previous segmment could be a navigation property or a navigation source segment + { + skip += 1; + GenerateTagName(out tagName, skip); } - else // ODataKeySegment or ODataNavigationSourceSegment + else // ODataNavigationSourceSegment { tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; } From 84f6acd33a9053302cca6841943a7d227d5513f8 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Mon, 30 Sep 2024 15:40:54 +0300 Subject: [PATCH 10/52] Update unit tests --- .../Operation/EdmActionOperationHandlerTests.cs | 4 ++-- .../Operation/EdmFunctionOperationHandlerTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs index 03d87da10..dca92aebe 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs @@ -40,7 +40,7 @@ public void CreateOperationForEdmActionReturnsCorrectOperation() Assert.Equal("Details of the shared trip.", operation.Description); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal("People.Actions", tag.Name); + Assert.Equal("People.Person", tag.Name); Assert.NotNull(operation.Parameters); Assert.Single(operation.Parameters); @@ -79,7 +79,7 @@ public void CreateOperationForEdmActionReturnsCorrectOperationHierarchicalClass( Assert.Equal($"Invoke action {actionName}", operation.Summary); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal($"{entitySetName}.Actions", tag.Name); + Assert.Equal($"{entitySetName}.AccountApiModel", tag.Name); Assert.NotNull(operation.Parameters); Assert.Single(operation.Parameters); diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index de817a521..4244b2254 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -100,7 +100,7 @@ public void CreateOperationForEdmFunctionReturnsCorrectOperation(bool useHTTPSta Assert.Equal("Invoke function GetFavoriteAirline", operation.Summary); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal("People.Functions", tag.Name); + Assert.Equal("People.Person", tag.Name); Assert.NotNull(operation.Parameters); Assert.Single(operation.Parameters); @@ -138,7 +138,7 @@ public void CreateOperationForEdmFunctionReturnsCorrectOperationHierarchicalClas Assert.Equal("Collection of contract attachments.", operation.Description); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal($"{entitySetName}.Functions", tag.Name); + Assert.Equal($"{entitySetName}.AccountApiModel", tag.Name); Assert.NotNull(operation.Parameters); Assert.Equal(6, operation.Parameters.Count); // id, top, skip, count, search, filter From 9fa069b85a53d36c9f68e607c64ff28aef0f1726 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Mon, 30 Sep 2024 15:44:33 +0300 Subject: [PATCH 11/52] Update integration test files --- .../Resources/Multiple.Schema.OpenApi.V2.json | 12 +-- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 8 +- .../Resources/Multiple.Schema.OpenApi.json | 12 +-- .../Resources/Multiple.Schema.OpenApi.yaml | 8 +- .../Resources/TripService.OpenApi.V2.json | 74 +++++++------------ .../Resources/TripService.OpenApi.V2.yaml | 62 +++++++--------- .../Resources/TripService.OpenApi.json | 74 +++++++------------ .../Resources/TripService.OpenApi.yaml | 62 +++++++--------- 8 files changed, 108 insertions(+), 204 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 7bcc154c2..599a83816 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -591,7 +591,7 @@ "/Documents({Id})/Default.Upload": { "post": { "tags": [ - "Documents.Actions" + "Documents.DocumentDto" ], "summary": "Invoke action Upload", "operationId": "Documents.DocumentDto.Upload", @@ -3519,7 +3519,7 @@ "/Tasks({Id})/Default.Upload": { "post": { "tags": [ - "Tasks.Actions" + "Tasks.DocumentDto" ], "summary": "Invoke action Upload", "operationId": "Tasks.DocumentDto.Upload", @@ -6274,10 +6274,6 @@ "name": "Documents.DocumentDto", "x-ms-docs-toc-type": "page" }, - { - "name": "Documents.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "Documents.RevisionDto", "x-ms-docs-toc-type": "page" @@ -6318,10 +6314,6 @@ "name": "Tasks.DocumentDto", "x-ms-docs-toc-type": "page" }, - { - "name": "Tasks.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "Tasks.RevisionDto", "x-ms-docs-toc-type": "page" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index e69a85f5d..daca60d1c 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -413,7 +413,7 @@ paths: '/Documents({Id})/Default.Upload': post: tags: - - Documents.Actions + - Documents.DocumentDto summary: Invoke action Upload operationId: Documents.DocumentDto.Upload parameters: @@ -2495,7 +2495,7 @@ paths: '/Tasks({Id})/Default.Upload': post: tags: - - Tasks.Actions + - Tasks.DocumentDto summary: Invoke action Upload operationId: Tasks.DocumentDto.Upload parameters: @@ -4544,8 +4544,6 @@ tags: x-ms-docs-toc-type: page - name: Documents.DocumentDto x-ms-docs-toc-type: page - - name: Documents.Actions - x-ms-docs-toc-type: container - name: Documents.RevisionDto x-ms-docs-toc-type: page - name: Documents.DocumentTagRelDto @@ -4566,8 +4564,6 @@ tags: x-ms-docs-toc-type: page - name: Tasks.DocumentDto x-ms-docs-toc-type: page - - name: Tasks.Actions - x-ms-docs-toc-type: container - name: Tasks.RevisionDto x-ms-docs-toc-type: page - name: Tasks.DocumentTagRelDto diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index 35f3f7e30..2733a9eb4 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -663,7 +663,7 @@ "description": "Provides operations to call the Upload method.", "post": { "tags": [ - "Documents.Actions" + "Documents.DocumentDto" ], "summary": "Invoke action Upload", "operationId": "Documents.DocumentDto.Upload", @@ -3940,7 +3940,7 @@ "description": "Provides operations to call the Upload method.", "post": { "tags": [ - "Tasks.Actions" + "Tasks.DocumentDto" ], "summary": "Invoke action Upload", "operationId": "Tasks.DocumentDto.Upload", @@ -7479,10 +7479,6 @@ "name": "Documents.DocumentDto", "x-ms-docs-toc-type": "page" }, - { - "name": "Documents.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "Documents.RevisionDto", "x-ms-docs-toc-type": "page" @@ -7523,10 +7519,6 @@ "name": "Tasks.DocumentDto", "x-ms-docs-toc-type": "page" }, - { - "name": "Tasks.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "Tasks.RevisionDto", "x-ms-docs-toc-type": "page" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 22f1882e1..6818ba562 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -460,7 +460,7 @@ paths: description: Provides operations to call the Upload method. post: tags: - - Documents.Actions + - Documents.DocumentDto summary: Invoke action Upload operationId: Documents.DocumentDto.Upload parameters: @@ -2771,7 +2771,7 @@ paths: description: Provides operations to call the Upload method. post: tags: - - Tasks.Actions + - Tasks.DocumentDto summary: Invoke action Upload operationId: Tasks.DocumentDto.Upload parameters: @@ -5382,8 +5382,6 @@ tags: x-ms-docs-toc-type: page - name: Documents.DocumentDto x-ms-docs-toc-type: page - - name: Documents.Actions - x-ms-docs-toc-type: container - name: Documents.RevisionDto x-ms-docs-toc-type: page - name: Documents.DocumentTagRelDto @@ -5404,8 +5402,6 @@ tags: x-ms-docs-toc-type: page - name: Tasks.DocumentDto x-ms-docs-toc-type: page - - name: Tasks.Actions - x-ms-docs-toc-type: container - name: Tasks.RevisionDto x-ms-docs-toc-type: page - name: Tasks.DocumentTagRelDto diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 3e3f587b8..317fb2223 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -7215,7 +7215,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "Me.Functions" + "Me.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople", @@ -7696,7 +7696,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { "get": { "tags": [ - "Me.Functions" + "Me.Person" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "Me.GetFavoriteAirline", @@ -7722,7 +7722,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": { "get": { "tags": [ - "Me.Functions" + "Me.Person" ], "summary": "Invoke function GetFriendsTrips", "operationId": "Me.GetFriendsTrips", @@ -7799,7 +7799,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { "post": { "tags": [ - "Me.Actions" + "Me.Person" ], "summary": "Invoke action GetPeersForTrip", "operationId": "Me.GetPeersForTrip", @@ -10930,7 +10930,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire": { "post": { "tags": [ - "Me.Actions" + "Me.Person" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -11287,7 +11287,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "Me.Functions" + "Me.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople", @@ -11768,7 +11768,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "Me.Actions" + "Me.Person" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -11800,7 +11800,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": { "get": { "tags": [ - "Me.Functions" + "Me.Person" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "Me.UpdatePersonLastName", @@ -12245,7 +12245,7 @@ "/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "Me.Functions" + "Me.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "Me.Trips.Trip.GetInvolvedPeople", @@ -15601,7 +15601,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Person" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "NewComePeople.Person.GetFavoriteAirline", @@ -15630,7 +15630,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": { "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Person" ], "summary": "Invoke function GetFriendsTrips", "operationId": "NewComePeople.Person.GetFriendsTrips", @@ -15715,7 +15715,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { "post": { "tags": [ - "NewComePeople.Actions" + "NewComePeople.Person" ], "summary": "Invoke action GetPeersForTrip", "operationId": "NewComePeople.Person.GetPeersForTrip", @@ -15747,7 +15747,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire": { "post": { "tags": [ - "NewComePeople.Actions" + "NewComePeople.Person" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -15794,7 +15794,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "NewComePeople.Actions" + "NewComePeople.Person" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -15827,7 +15827,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": { "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Person" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "NewComePeople.Person.UpdatePersonLastName", @@ -16275,7 +16275,7 @@ "/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "NewComePeople.Person.Trips.Trip.GetInvolvedPeople", @@ -23947,7 +23947,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "People.Functions" + "People.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople", @@ -24492,7 +24492,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { "get": { "tags": [ - "People.Functions" + "People.Person" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "People.Person.GetFavoriteAirline", @@ -24528,7 +24528,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": { "get": { "tags": [ - "People.Functions" + "People.Person" ], "summary": "Invoke function GetFriendsTrips", "operationId": "People.Person.GetFriendsTrips", @@ -24613,7 +24613,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { "post": { "tags": [ - "People.Actions" + "People.Person" ], "summary": "Invoke action GetPeersForTrip", "operationId": "People.Person.GetPeersForTrip", @@ -28312,7 +28312,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire": { "post": { "tags": [ - "People.Actions" + "People.Person" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -28717,7 +28717,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "People.Functions" + "People.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople", @@ -29262,7 +29262,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "People.Actions" + "People.Person" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -29302,7 +29302,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": { "get": { "tags": [ - "People.Functions" + "People.Person" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "People.Person.UpdatePersonLastName", @@ -29836,7 +29836,7 @@ "/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()": { "get": { "tags": [ - "People.Functions" + "People.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "People.Person.Trips.Trip.GetInvolvedPeople", @@ -31835,18 +31835,10 @@ "name": "Me.Trip", "x-ms-docs-toc-type": "page" }, - { - "name": "Me.Functions", - "x-ms-docs-toc-type": "container" - }, { "name": "Me.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, - { - "name": "Me.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "NewComePeople.Person", "x-ms-docs-toc-type": "page" @@ -31859,14 +31851,6 @@ "name": "NewComePeople.Person.Location", "x-ms-docs-toc-type": "page" }, - { - "name": "NewComePeople.Functions", - "x-ms-docs-toc-type": "container" - }, - { - "name": "NewComePeople.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "NewComePeople.Trip", "x-ms-docs-toc-type": "page" @@ -31891,18 +31875,10 @@ "name": "People.Trip", "x-ms-docs-toc-type": "page" }, - { - "name": "People.Functions", - "x-ms-docs-toc-type": "container" - }, { "name": "People.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, - { - "name": "People.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "ResetDataSource", "x-ms-docs-toc-type": "container" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index 89ee65362..9a1917758 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -4849,7 +4849,7 @@ paths: '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - Me.Functions + - Me.Trip summary: Invoke function GetInvolvedPeople operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople produces: @@ -5174,7 +5174,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline(): get: tags: - - Me.Functions + - Me.Person summary: Invoke function GetFavoriteAirline operationId: Me.GetFavoriteAirline responses: @@ -5193,7 +5193,7 @@ paths: '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')': get: tags: - - Me.Functions + - Me.Person summary: Invoke function GetFriendsTrips operationId: Me.GetFriendsTrips parameters: @@ -5241,7 +5241,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip: post: tags: - - Me.Actions + - Me.Person summary: Invoke action GetPeersForTrip operationId: Me.GetPeersForTrip parameters: @@ -7352,7 +7352,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire: post: tags: - - Me.Actions + - Me.Person summary: Invoke action Hire description: Hires someone for the company. operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -7602,7 +7602,7 @@ paths: '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - Me.Functions + - Me.Trip summary: Invoke function GetInvolvedPeople operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople produces: @@ -7927,7 +7927,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip: post: tags: - - Me.Actions + - Me.Person summary: Invoke action ShareTrip description: Details of the shared trip. operationId: Me.ShareTrip @@ -7949,7 +7949,7 @@ paths: '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')': get: tags: - - Me.Functions + - Me.Person summary: Invoke function UpdatePersonLastName operationId: Me.UpdatePersonLastName parameters: @@ -8262,7 +8262,7 @@ paths: '/Me/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - Me.Functions + - Me.Trip summary: Invoke function GetInvolvedPeople operationId: Me.Trips.Trip.GetInvolvedPeople produces: @@ -10502,7 +10502,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()': get: tags: - - NewComePeople.Functions + - NewComePeople.Person summary: Invoke function GetFavoriteAirline operationId: NewComePeople.Person.GetFavoriteAirline parameters: @@ -10522,7 +10522,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')': get: tags: - - NewComePeople.Functions + - NewComePeople.Person summary: Invoke function GetFriendsTrips operationId: NewComePeople.Person.GetFriendsTrips parameters: @@ -10576,7 +10576,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip': post: tags: - - NewComePeople.Actions + - NewComePeople.Person summary: Invoke action GetPeersForTrip operationId: NewComePeople.Person.GetPeersForTrip parameters: @@ -10597,7 +10597,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire': post: tags: - - NewComePeople.Actions + - NewComePeople.Person summary: Invoke action Hire description: Hires someone for the company. operationId: NewComePeople.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -10629,7 +10629,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip': post: tags: - - NewComePeople.Actions + - NewComePeople.Person summary: Invoke action ShareTrip description: Details of the shared trip. operationId: NewComePeople.Person.ShareTrip @@ -10651,7 +10651,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')': get: tags: - - NewComePeople.Functions + - NewComePeople.Person summary: Invoke function UpdatePersonLastName operationId: NewComePeople.Person.UpdatePersonLastName parameters: @@ -10959,7 +10959,7 @@ paths: '/NewComePeople/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - NewComePeople.Functions + - NewComePeople.Trip summary: Invoke function GetInvolvedPeople operationId: NewComePeople.Person.Trips.Trip.GetInvolvedPeople produces: @@ -16203,7 +16203,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - People.Functions + - People.Trip summary: Invoke function GetInvolvedPeople operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople produces: @@ -16576,7 +16576,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()': get: tags: - - People.Functions + - People.Person summary: Invoke function GetFavoriteAirline operationId: People.Person.GetFavoriteAirline parameters: @@ -16602,7 +16602,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')': get: tags: - - People.Functions + - People.Person summary: Invoke function GetFriendsTrips operationId: People.Person.GetFriendsTrips parameters: @@ -16656,7 +16656,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip': post: tags: - - People.Actions + - People.Person summary: Invoke action GetPeersForTrip operationId: People.Person.GetPeersForTrip parameters: @@ -19189,7 +19189,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire': post: tags: - - People.Actions + - People.Person summary: Invoke action Hire description: Hires someone for the company. operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -19475,7 +19475,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - People.Functions + - People.Trip summary: Invoke function GetInvolvedPeople operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople produces: @@ -19848,7 +19848,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip': post: tags: - - People.Actions + - People.Person summary: Invoke action ShareTrip description: Details of the shared trip. operationId: People.Person.ShareTrip @@ -19876,7 +19876,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')': get: tags: - - People.Functions + - People.Person summary: Invoke function UpdatePersonLastName operationId: People.Person.UpdatePersonLastName parameters: @@ -20256,7 +20256,7 @@ paths: '/People/{UserName}/Trips/{TripId}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetInvolvedPeople()': get: tags: - - People.Functions + - People.Trip summary: Invoke function GetInvolvedPeople operationId: People.Person.Trips.Trip.GetInvolvedPeople produces: @@ -21577,22 +21577,14 @@ tags: x-ms-docs-toc-type: page - name: Me.Trip x-ms-docs-toc-type: page - - name: Me.Functions - x-ms-docs-toc-type: container - name: Me.Trips.PlanItem x-ms-docs-toc-type: page - - name: Me.Actions - x-ms-docs-toc-type: container - name: NewComePeople.Person x-ms-docs-toc-type: page - name: NewComePeople.Location x-ms-docs-toc-type: page - name: NewComePeople.Person.Location x-ms-docs-toc-type: page - - name: NewComePeople.Functions - x-ms-docs-toc-type: container - - name: NewComePeople.Actions - x-ms-docs-toc-type: container - name: NewComePeople.Trip x-ms-docs-toc-type: page - name: NewComePeople.Trips.PlanItem @@ -21605,11 +21597,7 @@ tags: x-ms-docs-toc-type: page - name: People.Trip x-ms-docs-toc-type: page - - name: People.Functions - x-ms-docs-toc-type: container - name: People.Trips.PlanItem x-ms-docs-toc-type: page - - name: People.Actions - x-ms-docs-toc-type: container - name: ResetDataSource x-ms-docs-toc-type: container \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index d89fdd911..2c015301b 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -7973,7 +7973,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "Me.Functions" + "Me.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople", @@ -8514,7 +8514,7 @@ "description": "Provides operations to call the GetFavoriteAirline method.", "get": { "tags": [ - "Me.Functions" + "Me.Person" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "Me.GetFavoriteAirline", @@ -8540,7 +8540,7 @@ "description": "Provides operations to call the GetFriendsTrips method.", "get": { "tags": [ - "Me.Functions" + "Me.Person" ], "summary": "Invoke function GetFriendsTrips", "operationId": "Me.GetFriendsTrips", @@ -8634,7 +8634,7 @@ "description": "Provides operations to call the GetPeersForTrip method.", "post": { "tags": [ - "Me.Actions" + "Me.Person" ], "summary": "Invoke action GetPeersForTrip", "operationId": "Me.GetPeersForTrip", @@ -12050,7 +12050,7 @@ "description": "Provides operations to call the Hire method.", "post": { "tags": [ - "Me.Actions" + "Me.Person" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -12445,7 +12445,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "Me.Functions" + "Me.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople", @@ -12986,7 +12986,7 @@ "description": "Provides operations to call the ShareTrip method.", "post": { "tags": [ - "Me.Actions" + "Me.Person" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -13016,7 +13016,7 @@ "description": "Provides operations to call the UpdatePersonLastName method.", "get": { "tags": [ - "Me.Functions" + "Me.Person" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "Me.UpdatePersonLastName", @@ -13496,7 +13496,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "Me.Functions" + "Me.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "Me.Trips.Trip.GetInvolvedPeople", @@ -17305,7 +17305,7 @@ "description": "Provides operations to call the GetFavoriteAirline method.", "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Person" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "NewComePeople.Person.GetFavoriteAirline", @@ -17336,7 +17336,7 @@ "description": "Provides operations to call the GetFriendsTrips method.", "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Person" ], "summary": "Invoke function GetFriendsTrips", "operationId": "NewComePeople.Person.GetFriendsTrips", @@ -17440,7 +17440,7 @@ "description": "Provides operations to call the GetPeersForTrip method.", "post": { "tags": [ - "NewComePeople.Actions" + "NewComePeople.Person" ], "summary": "Invoke action GetPeersForTrip", "operationId": "NewComePeople.Person.GetPeersForTrip", @@ -17474,7 +17474,7 @@ "description": "Provides operations to call the Hire method.", "post": { "tags": [ - "NewComePeople.Actions" + "NewComePeople.Person" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -17530,7 +17530,7 @@ "description": "Provides operations to call the ShareTrip method.", "post": { "tags": [ - "NewComePeople.Actions" + "NewComePeople.Person" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -17565,7 +17565,7 @@ "description": "Provides operations to call the UpdatePersonLastName method.", "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Person" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "NewComePeople.Person.UpdatePersonLastName", @@ -18070,7 +18070,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "NewComePeople.Functions" + "NewComePeople.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "NewComePeople.Person.Trips.Trip.GetInvolvedPeople", @@ -26693,7 +26693,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "People.Functions" + "People.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople", @@ -27314,7 +27314,7 @@ "description": "Provides operations to call the GetFavoriteAirline method.", "get": { "tags": [ - "People.Functions" + "People.Person" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "People.Person.GetFavoriteAirline", @@ -27352,7 +27352,7 @@ "description": "Provides operations to call the GetFriendsTrips method.", "get": { "tags": [ - "People.Functions" + "People.Person" ], "summary": "Invoke function GetFriendsTrips", "operationId": "People.Person.GetFriendsTrips", @@ -27456,7 +27456,7 @@ "description": "Provides operations to call the GetPeersForTrip method.", "post": { "tags": [ - "People.Actions" + "People.Person" ], "summary": "Invoke action GetPeersForTrip", "operationId": "People.Person.GetPeersForTrip", @@ -31598,7 +31598,7 @@ "description": "Provides operations to call the Hire method.", "post": { "tags": [ - "People.Actions" + "People.Person" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -32057,7 +32057,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "People.Functions" + "People.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople", @@ -32678,7 +32678,7 @@ "description": "Provides operations to call the ShareTrip method.", "post": { "tags": [ - "People.Actions" + "People.Person" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -32720,7 +32720,7 @@ "description": "Provides operations to call the UpdatePersonLastName method.", "get": { "tags": [ - "People.Functions" + "People.Person" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "People.Person.UpdatePersonLastName", @@ -33311,7 +33311,7 @@ "description": "Provides operations to call the GetInvolvedPeople method.", "get": { "tags": [ - "People.Functions" + "People.Trip" ], "summary": "Invoke function GetInvolvedPeople", "operationId": "People.Person.Trips.Trip.GetInvolvedPeople", @@ -35858,18 +35858,10 @@ "name": "Me.Trip", "x-ms-docs-toc-type": "page" }, - { - "name": "Me.Functions", - "x-ms-docs-toc-type": "container" - }, { "name": "Me.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, - { - "name": "Me.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "NewComePeople.Person", "x-ms-docs-toc-type": "page" @@ -35882,14 +35874,6 @@ "name": "NewComePeople.Person.Location", "x-ms-docs-toc-type": "page" }, - { - "name": "NewComePeople.Functions", - "x-ms-docs-toc-type": "container" - }, - { - "name": "NewComePeople.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "NewComePeople.Trip", "x-ms-docs-toc-type": "page" @@ -35914,18 +35898,10 @@ "name": "People.Trip", "x-ms-docs-toc-type": "page" }, - { - "name": "People.Functions", - "x-ms-docs-toc-type": "container" - }, { "name": "People.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, - { - "name": "People.Actions", - "x-ms-docs-toc-type": "container" - }, { "name": "ResetDataSource", "x-ms-docs-toc-type": "container" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 25510e863..430334abd 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -5331,7 +5331,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - Me.Functions + - Me.Trip summary: Invoke function GetInvolvedPeople operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople parameters: @@ -5697,7 +5697,7 @@ paths: description: Provides operations to call the GetFavoriteAirline method. get: tags: - - Me.Functions + - Me.Person summary: Invoke function GetFavoriteAirline operationId: Me.GetFavoriteAirline responses: @@ -5716,7 +5716,7 @@ paths: description: Provides operations to call the GetFriendsTrips method. get: tags: - - Me.Functions + - Me.Person summary: Invoke function GetFriendsTrips operationId: Me.GetFriendsTrips parameters: @@ -5777,7 +5777,7 @@ paths: description: Provides operations to call the GetPeersForTrip method. post: tags: - - Me.Actions + - Me.Person summary: Invoke action GetPeersForTrip operationId: Me.GetPeersForTrip requestBody: @@ -8075,7 +8075,7 @@ paths: description: Provides operations to call the Hire method. post: tags: - - Me.Actions + - Me.Person summary: Invoke action Hire description: Hires someone for the company. operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -8348,7 +8348,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - Me.Functions + - Me.Trip summary: Invoke function GetInvolvedPeople operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople parameters: @@ -8714,7 +8714,7 @@ paths: description: Provides operations to call the ShareTrip method. post: tags: - - Me.Actions + - Me.Person summary: Invoke action ShareTrip description: Details of the shared trip. operationId: Me.ShareTrip @@ -8736,7 +8736,7 @@ paths: description: Provides operations to call the UpdatePersonLastName method. get: tags: - - Me.Functions + - Me.Person summary: Invoke function UpdatePersonLastName operationId: Me.UpdatePersonLastName parameters: @@ -9071,7 +9071,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - Me.Functions + - Me.Trip summary: Invoke function GetInvolvedPeople operationId: Me.Trips.Trip.GetInvolvedPeople parameters: @@ -11594,7 +11594,7 @@ paths: description: Provides operations to call the GetFavoriteAirline method. get: tags: - - NewComePeople.Functions + - NewComePeople.Person summary: Invoke function GetFavoriteAirline operationId: NewComePeople.Person.GetFavoriteAirline parameters: @@ -11615,7 +11615,7 @@ paths: description: Provides operations to call the GetFriendsTrips method. get: tags: - - NewComePeople.Functions + - NewComePeople.Person summary: Invoke function GetFriendsTrips operationId: NewComePeople.Person.GetFriendsTrips parameters: @@ -11683,7 +11683,7 @@ paths: description: Provides operations to call the GetPeersForTrip method. post: tags: - - NewComePeople.Actions + - NewComePeople.Person summary: Invoke action GetPeersForTrip operationId: NewComePeople.Person.GetPeersForTrip parameters: @@ -11706,7 +11706,7 @@ paths: description: Provides operations to call the Hire method. post: tags: - - NewComePeople.Actions + - NewComePeople.Person summary: Invoke action Hire description: Hires someone for the company. operationId: NewComePeople.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -11741,7 +11741,7 @@ paths: description: Provides operations to call the ShareTrip method. post: tags: - - NewComePeople.Actions + - NewComePeople.Person summary: Invoke action ShareTrip description: Details of the shared trip. operationId: NewComePeople.Person.ShareTrip @@ -11765,7 +11765,7 @@ paths: description: Provides operations to call the UpdatePersonLastName method. get: tags: - - NewComePeople.Functions + - NewComePeople.Person summary: Invoke function UpdatePersonLastName operationId: NewComePeople.Person.UpdatePersonLastName parameters: @@ -12106,7 +12106,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - NewComePeople.Functions + - NewComePeople.Trip summary: Invoke function GetInvolvedPeople operationId: NewComePeople.Person.Trips.Trip.GetInvolvedPeople parameters: @@ -17931,7 +17931,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - People.Functions + - People.Trip summary: Invoke function GetInvolvedPeople operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Employee.Trips.Trip.GetInvolvedPeople parameters: @@ -18353,7 +18353,7 @@ paths: description: Provides operations to call the GetFavoriteAirline method. get: tags: - - People.Functions + - People.Person summary: Invoke function GetFavoriteAirline operationId: People.Person.GetFavoriteAirline parameters: @@ -18380,7 +18380,7 @@ paths: description: Provides operations to call the GetFriendsTrips method. get: tags: - - People.Functions + - People.Person summary: Invoke function GetFriendsTrips operationId: People.Person.GetFriendsTrips parameters: @@ -18448,7 +18448,7 @@ paths: description: Provides operations to call the GetPeersForTrip method. post: tags: - - People.Actions + - People.Person summary: Invoke action GetPeersForTrip operationId: People.Person.GetPeersForTrip parameters: @@ -21247,7 +21247,7 @@ paths: description: Provides operations to call the Hire method. post: tags: - - People.Actions + - People.Person summary: Invoke action Hire description: Hires someone for the company. operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -21564,7 +21564,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - People.Functions + - People.Trip summary: Invoke function GetInvolvedPeople operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Trips.Trip.GetInvolvedPeople parameters: @@ -21986,7 +21986,7 @@ paths: description: Provides operations to call the ShareTrip method. post: tags: - - People.Actions + - People.Person summary: Invoke action ShareTrip description: Details of the shared trip. operationId: People.Person.ShareTrip @@ -22016,7 +22016,7 @@ paths: description: Provides operations to call the UpdatePersonLastName method. get: tags: - - People.Functions + - People.Person summary: Invoke function UpdatePersonLastName operationId: People.Person.UpdatePersonLastName parameters: @@ -22429,7 +22429,7 @@ paths: description: Provides operations to call the GetInvolvedPeople method. get: tags: - - People.Functions + - People.Trip summary: Invoke function GetInvolvedPeople operationId: People.Person.Trips.Trip.GetInvolvedPeople parameters: @@ -24065,22 +24065,14 @@ tags: x-ms-docs-toc-type: page - name: Me.Trip x-ms-docs-toc-type: page - - name: Me.Functions - x-ms-docs-toc-type: container - name: Me.Trips.PlanItem x-ms-docs-toc-type: page - - name: Me.Actions - x-ms-docs-toc-type: container - name: NewComePeople.Person x-ms-docs-toc-type: page - name: NewComePeople.Location x-ms-docs-toc-type: page - name: NewComePeople.Person.Location x-ms-docs-toc-type: page - - name: NewComePeople.Functions - x-ms-docs-toc-type: container - - name: NewComePeople.Actions - x-ms-docs-toc-type: container - name: NewComePeople.Trip x-ms-docs-toc-type: page - name: NewComePeople.Trips.PlanItem @@ -24093,11 +24085,7 @@ tags: x-ms-docs-toc-type: page - name: People.Trip x-ms-docs-toc-type: page - - name: People.Functions - x-ms-docs-toc-type: container - name: People.Trips.PlanItem x-ms-docs-toc-type: page - - name: People.Actions - x-ms-docs-toc-type: container - name: ResetDataSource x-ms-docs-toc-type: container \ No newline at end of file From c25de308d361d6d32279f2b2e82e3263c76d1061 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:48:00 +0300 Subject: [PATCH 12/52] Update src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs Co-authored-by: Andrew Omondi --- .../Operation/EdmOperationOperationHandler.cs | 573 +++++++++--------- 1 file changed, 288 insertions(+), 285 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index cbb31909b..ea4266a8a 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -1,94 +1,94 @@ -// ------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. -// ------------------------------------------------------------ - -using System.Collections.Generic; -using System.Linq; -using Microsoft.OData.Edm; -using Microsoft.OpenApi.Any; -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.OData.Common; -using Microsoft.OpenApi.OData.Edm; -using Microsoft.OpenApi.OData.Generator; -using Microsoft.OpenApi.OData.Vocabulary.Capabilities; -using Microsoft.OpenApi.OData.Vocabulary.Core; - -namespace Microsoft.OpenApi.OData.Operation -{ - /// - /// Base class for operation of . - /// - internal abstract class EdmOperationOperationHandler : OperationHandler - { - private OperationRestrictionsType _operationRestriction; - - /// - /// Gets the navigation source. - /// - protected IEdmNavigationSource NavigationSource { get; private set; } - - /// - /// Gets the Edm operation. - /// - protected IEdmOperation EdmOperation { get; private set; } - - /// - /// Gets the OData operation segment. - /// - protected ODataOperationSegment OperationSegment { get; private set; } - - /// - /// Gets a value indicating whether the path has type cast segment or not. - /// - protected bool HasTypeCast { get; private set; } - - /// - protected override void Initialize(ODataContext context, ODataPath path) +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. +// ------------------------------------------------------------ + +using System.Collections.Generic; +using System.Linq; +using Microsoft.OData.Edm; +using Microsoft.OpenApi.Any; +using Microsoft.OpenApi.Models; +using Microsoft.OpenApi.OData.Common; +using Microsoft.OpenApi.OData.Edm; +using Microsoft.OpenApi.OData.Generator; +using Microsoft.OpenApi.OData.Vocabulary.Capabilities; +using Microsoft.OpenApi.OData.Vocabulary.Core; + +namespace Microsoft.OpenApi.OData.Operation +{ + /// + /// Base class for operation of . + /// + internal abstract class EdmOperationOperationHandler : OperationHandler + { + private OperationRestrictionsType _operationRestriction; + + /// + /// Gets the navigation source. + /// + protected IEdmNavigationSource NavigationSource { get; private set; } + + /// + /// Gets the Edm operation. + /// + protected IEdmOperation EdmOperation { get; private set; } + + /// + /// Gets the OData operation segment. + /// + protected ODataOperationSegment OperationSegment { get; private set; } + + /// + /// Gets a value indicating whether the path has type cast segment or not. + /// + protected bool HasTypeCast { get; private set; } + + /// + protected override void Initialize(ODataContext context, ODataPath path) { - base.Initialize(context, path); - - // It's bound operation, the first segment must be the navigaiton source. - ODataNavigationSourceSegment navigationSourceSegment = path.FirstSegment as ODataNavigationSourceSegment; - NavigationSource = navigationSourceSegment.NavigationSource; - - OperationSegment = path.LastSegment as ODataOperationSegment; - EdmOperation = OperationSegment.Operation; - - HasTypeCast = path.Segments.Any(s => s is ODataTypeCastSegment); - + base.Initialize(context, path); + + // It's bound operation, the first segment must be the navigaiton source. + ODataNavigationSourceSegment navigationSourceSegment = path.FirstSegment as ODataNavigationSourceSegment; + NavigationSource = navigationSourceSegment.NavigationSource; + + OperationSegment = path.LastSegment as ODataOperationSegment; + EdmOperation = OperationSegment.Operation; + + HasTypeCast = path.Segments.Any(s => s is ODataTypeCastSegment); + _operationRestriction = Context.Model.GetRecord(TargetPath, CapabilitiesConstants.OperationRestrictions); var operationRestrictions = Context.Model.GetRecord(EdmOperation, CapabilitiesConstants.OperationRestrictions); _operationRestriction?.MergePropertiesIfNull(operationRestrictions); - _operationRestriction ??= operationRestrictions; - } - - /// - protected override void SetBasicInfo(OpenApiOperation operation) - { - // Summary - operation.Summary = "Invoke " + (EdmOperation.IsAction() ? "action " : "function ") + EdmOperation.Name; - - // Description - operation.Description = Context.Model.GetDescriptionAnnotation(TargetPath) ?? Context.Model.GetDescriptionAnnotation(EdmOperation); - - // OperationId - if (Context.Settings.EnableOperationId) - { - // When the key segment is available, - // its EntityType name will be used - // in the operationId to avoid potential - // duplicates in entity vs entityset functions/actions - - List identifiers = new(); - foreach (ODataSegment segment in Path.Segments) - { - if (segment is ODataKeySegment keySegment) - { - if (!keySegment.IsAlternateKey) - { - identifiers.Add(segment.EntityType.Name); - continue; + _operationRestriction ??= operationRestrictions; + } + + /// + protected override void SetBasicInfo(OpenApiOperation operation) + { + // Summary + operation.Summary = "Invoke " + (EdmOperation.IsAction() ? "action " : "function ") + EdmOperation.Name; + + // Description + operation.Description = Context.Model.GetDescriptionAnnotation(TargetPath) ?? Context.Model.GetDescriptionAnnotation(EdmOperation); + + // OperationId + if (Context.Settings.EnableOperationId) + { + // When the key segment is available, + // its EntityType name will be used + // in the operationId to avoid potential + // duplicates in entity vs entityset functions/actions + + List identifiers = new(); + foreach (ODataSegment segment in Path.Segments) + { + if (segment is ODataKeySegment keySegment) + { + if (!keySegment.IsAlternateKey) + { + identifiers.Add(segment.EntityType.Name); + continue; } // We'll consider alternate keys in the operation id to eliminate potential duplicates with operation id of primary path @@ -100,200 +100,203 @@ protected override void SetBasicInfo(OpenApiOperation operation) { identifiers.Add(keySegment.Identifier); } - } - else - { + } + else + { identifiers.Add(segment.Identifier); - } - } - - string operationId = string.Join(".", identifiers); - - if (EdmOperation.IsAction()) - { - operation.OperationId = operationId; - } - else - { - if (Path.LastSegment is ODataOperationSegment operationSegment && - Context.Model.IsOperationOverload(operationSegment.Operation)) - { - operation.OperationId = operationId + "-" + Path.LastSegment.GetPathHash(Context.Settings); - } - else - { - operation.OperationId = operationId; - } - } - } - - base.SetBasicInfo(operation); - } - - /// - protected override void SetTags(OpenApiOperation operation) + } + } + + string operationId = string.Join(".", identifiers); + + if (EdmOperation.IsAction()) + { + operation.OperationId = operationId; + } + else + { + if (Path.LastSegment is ODataOperationSegment operationSegment && + Context.Model.IsOperationOverload(operationSegment.Operation)) + { + operation.OperationId = operationId + "-" + Path.LastSegment.GetPathHash(Context.Settings); + } + else + { + operation.OperationId = operationId; + } + } + } + + base.SetBasicInfo(operation); + } + + /// + protected override void SetTags(OpenApiOperation operation) { GenerateTagName(out string tagName); OpenApiTag tag = new() - { - Name = tagName, - }; - tag.Extensions.Add(Constants.xMsTocType, new OpenApiString("container")); - operation.Tags.Add(tag); - - Context.AppendTag(tag); - - base.SetTags(operation); - } - + { + Name = tagName, + }; + tag.Extensions.Add(Constants.xMsTocType, new OpenApiString("container")); + operation.Tags.Add(tag); + + Context.AppendTag(tag); + + base.SetTags(operation); + } + /// /// Genrates the tag name for the operation. /// /// The generated tag name. - /// The number of segments to skip. + /// The number of segments to skip. private void GenerateTagName(out string tagName, int skip = 1) { var targetSegment = Path.Segments.Reverse().Skip(skip).First(); - if (targetSegment is ODataNavigationPropertySegment) + switch (targetSegment) + { + case ODataNavigationPropertySegment: + tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context); + break; + case ODataOperationSegment: + case ODataOperationImportSegment: + // Previous segmment could be a navigation property or a navigation source segment + case ODataKeySegment: + skip += 1; + GenerateTagName(out tagName, skip); + break; + // ODataNavigationSourceSegment + default: + tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + break; + } + } + + /// + protected override void SetParameters(OpenApiOperation operation) + { + base.SetParameters(operation); + + if (EdmOperation.IsFunction()) { - tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context); + IEdmFunction function = (IEdmFunction)EdmOperation; + AppendSystemQueryOptions(function, operation); } - else if (targetSegment is ODataOperationSegment || targetSegment is ODataOperationImportSegment // Composable function - || targetSegment is ODataKeySegment) // Previous segmment could be a navigation property or a navigation source segment - { - skip += 1; - GenerateTagName(out tagName, skip); + } + + /// + protected override void SetResponses(OpenApiOperation operation) + { + operation.Responses = Context.CreateResponses(EdmOperation); + base.SetResponses(operation); + } + + /// + protected override void SetSecurity(OpenApiOperation operation) + { + if (_operationRestriction == null || _operationRestriction.Permissions == null) + { + return; + } + + operation.Security = Context.CreateSecurityRequirements(_operationRestriction.Permissions).ToList(); + } + + /// + protected override void AppendCustomParameters(OpenApiOperation operation) + { + if (_operationRestriction == null) + { + return; + } + + if (_operationRestriction.CustomHeaders != null) + { + AppendCustomParameters(operation, _operationRestriction.CustomHeaders, ParameterLocation.Header); } - else // ODataNavigationSourceSegment + + if (_operationRestriction.CustomQueryOptions != null) { - tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + AppendCustomParameters(operation, _operationRestriction.CustomQueryOptions, ParameterLocation.Query); } - } - - /// - protected override void SetParameters(OpenApiOperation operation) - { - base.SetParameters(operation); - - if (EdmOperation.IsFunction()) - { - IEdmFunction function = (IEdmFunction)EdmOperation; - AppendSystemQueryOptions(function, operation); - } - } - - /// - protected override void SetResponses(OpenApiOperation operation) - { - operation.Responses = Context.CreateResponses(EdmOperation); - base.SetResponses(operation); - } - - /// - protected override void SetSecurity(OpenApiOperation operation) - { - if (_operationRestriction == null || _operationRestriction.Permissions == null) - { - return; - } - - operation.Security = Context.CreateSecurityRequirements(_operationRestriction.Permissions).ToList(); - } - - /// - protected override void AppendCustomParameters(OpenApiOperation operation) - { - if (_operationRestriction == null) - { - return; - } - - if (_operationRestriction.CustomHeaders != null) - { - AppendCustomParameters(operation, _operationRestriction.CustomHeaders, ParameterLocation.Header); - } - - if (_operationRestriction.CustomQueryOptions != null) - { - AppendCustomParameters(operation, _operationRestriction.CustomQueryOptions, ParameterLocation.Query); - } - } - - private void AppendSystemQueryOptions(IEdmFunction function, OpenApiOperation operation) - { - if (function.ReturnType.IsCollection()) - { - // $top - if (Context.CreateTop(function) is OpenApiParameter topParameter) - { - operation.Parameters.AppendParameter(topParameter); - } - - // $skip - if (Context.CreateSkip(function) is OpenApiParameter skipParameter) - { - operation.Parameters.AppendParameter(skipParameter); - } - - // $search - if (Context.CreateSearch(function) is OpenApiParameter searchParameter) - { - operation.Parameters.AppendParameter(searchParameter); - } - - // $filter - if (Context.CreateFilter(function) is OpenApiParameter filterParameter) - { - operation.Parameters.AppendParameter(filterParameter); - } - - // $count - if (Context.CreateCount(function) is OpenApiParameter countParameter) - { - operation.Parameters.AppendParameter(countParameter); - } - - if (function.ReturnType?.Definition?.AsElementType() is IEdmEntityType entityType) - { - // $select - if (Context.CreateSelect(function, entityType) is OpenApiParameter selectParameter) - { - operation.Parameters.AppendParameter(selectParameter); - } - - // $orderby - if (Context.CreateOrderBy(function, entityType) is OpenApiParameter orderbyParameter) - { - operation.Parameters.AppendParameter(orderbyParameter); - } - - // $expand - if (Context.CreateExpand(function, entityType) is OpenApiParameter expandParameter) - { - operation.Parameters.AppendParameter(expandParameter); - } - } - } - } - - /// - protected override void SetCustomLinkRelType() - { - if (Context.Settings.CustomHttpMethodLinkRelMapping != null && EdmOperation != null) - { - LinkRelKey key = EdmOperation.IsAction() ? LinkRelKey.Action : LinkRelKey.Function; - Context.Settings.CustomHttpMethodLinkRelMapping.TryGetValue(key, out string linkRelValue); - CustomLinkRel = linkRelValue; - } - } - - /// - protected override void SetExternalDocs(OpenApiOperation operation) - { - if (Context.Settings.ShowExternalDocs) - { - var externalDocs = Context.Model.GetLinkRecord(TargetPath, CustomLinkRel) ?? + } + + private void AppendSystemQueryOptions(IEdmFunction function, OpenApiOperation operation) + { + if (function.ReturnType.IsCollection()) + { + // $top + if (Context.CreateTop(function) is OpenApiParameter topParameter) + { + operation.Parameters.AppendParameter(topParameter); + } + + // $skip + if (Context.CreateSkip(function) is OpenApiParameter skipParameter) + { + operation.Parameters.AppendParameter(skipParameter); + } + + // $search + if (Context.CreateSearch(function) is OpenApiParameter searchParameter) + { + operation.Parameters.AppendParameter(searchParameter); + } + + // $filter + if (Context.CreateFilter(function) is OpenApiParameter filterParameter) + { + operation.Parameters.AppendParameter(filterParameter); + } + + // $count + if (Context.CreateCount(function) is OpenApiParameter countParameter) + { + operation.Parameters.AppendParameter(countParameter); + } + + if (function.ReturnType?.Definition?.AsElementType() is IEdmEntityType entityType) + { + // $select + if (Context.CreateSelect(function, entityType) is OpenApiParameter selectParameter) + { + operation.Parameters.AppendParameter(selectParameter); + } + + // $orderby + if (Context.CreateOrderBy(function, entityType) is OpenApiParameter orderbyParameter) + { + operation.Parameters.AppendParameter(orderbyParameter); + } + + // $expand + if (Context.CreateExpand(function, entityType) is OpenApiParameter expandParameter) + { + operation.Parameters.AppendParameter(expandParameter); + } + } + } + } + + /// + protected override void SetCustomLinkRelType() + { + if (Context.Settings.CustomHttpMethodLinkRelMapping != null && EdmOperation != null) + { + LinkRelKey key = EdmOperation.IsAction() ? LinkRelKey.Action : LinkRelKey.Function; + Context.Settings.CustomHttpMethodLinkRelMapping.TryGetValue(key, out string linkRelValue); + CustomLinkRel = linkRelValue; + } + } + + /// + protected override void SetExternalDocs(OpenApiOperation operation) + { + if (Context.Settings.ShowExternalDocs) + { + var externalDocs = Context.Model.GetLinkRecord(TargetPath, CustomLinkRel) ?? Context.Model.GetLinkRecord(EdmOperation, CustomLinkRel); if (externalDocs != null) @@ -303,24 +306,24 @@ protected override void SetExternalDocs(OpenApiOperation operation) Description = CoreConstants.ExternalDocsDescription, Url = externalDocs.Href }; - } - } - } - - // - protected override void SetExtensions(OpenApiOperation operation) - { - if (Context.Settings.EnablePagination && EdmOperation.ReturnType?.TypeKind() == EdmTypeKind.Collection) - { - OpenApiObject extension = new OpenApiObject - { - { "nextLinkName", new OpenApiString("@odata.nextLink")}, - { "operationName", new OpenApiString(Context.Settings.PageableOperationName)} - }; - - operation.Extensions.Add(Constants.xMsPageable, extension); - } - base.SetExtensions(operation); - } - } -} + } + } + } + + // + protected override void SetExtensions(OpenApiOperation operation) + { + if (Context.Settings.EnablePagination && EdmOperation.ReturnType?.TypeKind() == EdmTypeKind.Collection) + { + OpenApiObject extension = new OpenApiObject + { + { "nextLinkName", new OpenApiString("@odata.nextLink")}, + { "operationName", new OpenApiString(Context.Settings.PageableOperationName)} + }; + + operation.Extensions.Add(Constants.xMsPageable, extension); + } + base.SetExtensions(operation); + } + } +} From e1e4733ea16142f23080094dbe1d64c05a5b65a9 Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 1 Oct 2024 15:50:16 +0300 Subject: [PATCH 13/52] Account for nullability --- .../Operation/EdmOperationOperationHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index ea4266a8a..79ffa4e2e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -153,7 +153,8 @@ protected override void SetTags(OpenApiOperation operation) /// The number of segments to skip. private void GenerateTagName(out string tagName, int skip = 1) { - var targetSegment = Path.Segments.Reverse().Skip(skip).First(); + var targetSegment = Path.Segments.Reverse().Skip(skip).FirstOrDefault(); + targetSegment = null; switch (targetSegment) { From 0ab5b4542717026dfa1d8313b6205809db32446c Mon Sep 17 00:00:00 2001 From: Irvine Sunday Date: Tue, 1 Oct 2024 16:05:55 +0300 Subject: [PATCH 14/52] Remove unnecessary code --- .../Operation/EdmOperationOperationHandler.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 79ffa4e2e..55ad88b21 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -154,7 +154,6 @@ protected override void SetTags(OpenApiOperation operation) private void GenerateTagName(out string tagName, int skip = 1) { var targetSegment = Path.Segments.Reverse().Skip(skip).FirstOrDefault(); - targetSegment = null; switch (targetSegment) { From ebc06713f4d02067e2f4ec2fff234380bae732dd Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 12:20:28 -0500 Subject: [PATCH 15/52] chore: fix merge issue --- .../Operation/EdmOperationOperationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 55ad88b21..751e26008 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -169,7 +169,7 @@ private void GenerateTagName(out string tagName, int skip = 1) break; // ODataNavigationSourceSegment default: - tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name; break; } } From 14e498016c7ecba8ad7f01ac530924d6175eeb69 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:33:53 +0300 Subject: [PATCH 16/52] Adds nullable to `double` schema conversions (#589) * Update double schema * Update integration file tests * Update release notes --- .../Generator/OpenApiEdmTypeSchemaGenerator.cs | 4 ++-- .../Generator/OpenApiSchemaGenerator.cs | 8 +++++--- .../Generator/OpenApiSchemaGeneratorTests.cs | 6 ++++-- .../Resources/Basic.OpenApi.V2.json | 3 ++- .../Resources/Basic.OpenApi.V2.yaml | 1 + .../Resources/Basic.OpenApi.json | 4 +++- .../Resources/Basic.OpenApi.yaml | 2 ++ .../Resources/Empty.OpenApi.V2.json | 3 ++- .../Resources/Empty.OpenApi.V2.yaml | 1 + .../Resources/Empty.OpenApi.json | 4 +++- .../Resources/Empty.OpenApi.yaml | 2 ++ .../Resources/Multiple.Schema.OpenApi.V2.json | 3 ++- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 1 + .../Resources/Multiple.Schema.OpenApi.json | 4 +++- .../Resources/Multiple.Schema.OpenApi.yaml | 2 ++ .../Resources/TripService.OpenApi.V2.json | 3 ++- .../Resources/TripService.OpenApi.V2.yaml | 1 + .../Resources/TripService.OpenApi.json | 16 +++++++++++----- .../Resources/TripService.OpenApi.yaml | 6 ++++++ 19 files changed, 55 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs index 24ab0d006..510f07a81 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs @@ -195,8 +195,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv case EdmPrimitiveTypeKind.Double: // double schema.OneOf = new List { - new OpenApiSchema { Type = Constants.NumberType, Format = "double" }, - new OpenApiSchema { Type = Constants.StringType }, + new OpenApiSchema { Type = Constants.NumberType, Format = "double", Nullable = true }, + new OpenApiSchema { Type = Constants.StringType, Nullable = true }, new OpenApiSchema { UnresolvedReference = true, diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs index bcbf6aea2..f32e9e18d 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs @@ -121,12 +121,14 @@ public static IDictionary CreateSchemas(this ODataContext schemas[Constants.ReferenceNumericName] = new() { - Enum = new List - { + Type = Constants.StringType, + Nullable = true, + Enum = + [ new OpenApiString("-INF"), new OpenApiString("INF"), new OpenApiString("NaN") - } + ] }; if (context.Settings.EnableODataAnnotationReferencesForResponses) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs index 32b39812e..712b38c2b 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs @@ -1105,10 +1105,12 @@ public void NonNullableDoublePropertyWithDefaultStringWorks() ""oneOf"": [ { ""type"": ""number"", - ""format"": ""double"" + ""format"": ""double"", + ""nullable"": true }, { - ""type"": ""string"" + ""type"": ""string"", + ""nullable"": true }, { ""$ref"": ""#/components/schemas/ReferenceNumeric"" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json index 5be9fd5a0..217579675 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json @@ -1152,7 +1152,8 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string" } }, "parameters": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml index efedb95ee..de8441550 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml @@ -757,6 +757,7 @@ definitions: - '-INF' - INF - NaN + type: string parameters: top: in: query diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json index 6a1b83ca8..e7ea0cc51 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json @@ -1258,7 +1258,9 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string", + "nullable": true } }, "responses": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml index 408cd572c..c192e98db 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml @@ -829,6 +829,8 @@ components: - '-INF' - INF - NaN + type: string + nullable: true responses: error: description: error diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json index 972656d0f..3b1a6c860 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.json @@ -103,7 +103,8 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string" } }, "parameters": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml index 1f1015078..a75539a52 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.V2.yaml @@ -71,6 +71,7 @@ definitions: - '-INF' - INF - NaN + type: string parameters: top: in: query diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json index 463e153e6..64796606e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.json @@ -108,7 +108,9 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string", + "nullable": true } }, "responses": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml index db82e6a53..5bc83853a 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Empty.OpenApi.yaml @@ -74,6 +74,8 @@ components: - '-INF' - INF - NaN + type: string + nullable: true responses: error: description: error diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 7bcc154c2..10e4853a6 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -6118,7 +6118,8 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string" } }, "parameters": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index e69a85f5d..2f7e0c2c5 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -4436,6 +4436,7 @@ definitions: - '-INF' - INF - NaN + type: string parameters: top: in: query diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index 35f3f7e30..abb6b1b9d 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -6835,7 +6835,9 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string", + "nullable": true } }, "responses": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index 22f1882e1..cd96032bb 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -4921,6 +4921,8 @@ components: - '-INF' - INF - NaN + type: string + nullable: true responses: error: description: error diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 3e3f587b8..f26cdbedf 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -31561,7 +31561,8 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string" } }, "parameters": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index 89ee65362..b960188e6 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -21393,6 +21393,7 @@ definitions: - '-INF' - INF - NaN + type: string parameters: top: in: query diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index d89fdd911..2210b1217 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -1397,10 +1397,12 @@ "oneOf": [ { "type": "number", - "format": "double" + "format": "double", + "nullable": true }, { - "type": "string" + "type": "string", + "nullable": true }, { "$ref": "#/components/schemas/ReferenceNumeric" @@ -1416,10 +1418,12 @@ "oneOf": [ { "type": "number", - "format": "double" + "format": "double", + "nullable": true }, { - "type": "string" + "type": "string", + "nullable": true }, { "$ref": "#/components/schemas/ReferenceNumeric" @@ -35293,7 +35297,9 @@ "-INF", "INF", "NaN" - ] + ], + "type": "string", + "nullable": true } }, "responses": { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 25510e863..ccd8ef1f8 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -914,7 +914,9 @@ paths: oneOf: - type: number format: double + nullable: true - type: string + nullable: true - $ref: '#/components/schemas/ReferenceNumeric' - name: lon in: path @@ -923,7 +925,9 @@ paths: oneOf: - type: number format: double + nullable: true - type: string + nullable: true - $ref: '#/components/schemas/ReferenceNumeric' responses: '200': @@ -23713,6 +23717,8 @@ components: - '-INF' - INF - NaN + type: string + nullable: true responses: error: description: error From 417ad69259b13ddb036150511f579d9ca836da24 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Oct 2024 07:00:37 -0400 Subject: [PATCH 17/52] chore: cleans up old solution file that messes up solution loading in vscode Signed-off-by: Vincent Biret --- tool/UpdateDocs/UpdateDocs.sln | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 tool/UpdateDocs/UpdateDocs.sln diff --git a/tool/UpdateDocs/UpdateDocs.sln b/tool/UpdateDocs/UpdateDocs.sln deleted file mode 100644 index cd707c7a2..000000000 --- a/tool/UpdateDocs/UpdateDocs.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30914.41 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateDocs", "UpdateDocs.csproj", "{6D5453C2-E35F-4CC6-B774-4C676F5F33D1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.OpenApi.OData.Reader", "..\..\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenApi.OData.Reader.csproj", "{B7A15A06-0B61-4557-9BD4-0E4F32DE119D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6D5453C2-E35F-4CC6-B774-4C676F5F33D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D5453C2-E35F-4CC6-B774-4C676F5F33D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D5453C2-E35F-4CC6-B774-4C676F5F33D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D5453C2-E35F-4CC6-B774-4C676F5F33D1}.Release|Any CPU.Build.0 = Release|Any CPU - {B7A15A06-0B61-4557-9BD4-0E4F32DE119D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7A15A06-0B61-4557-9BD4-0E4F32DE119D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7A15A06-0B61-4557-9BD4-0E4F32DE119D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7A15A06-0B61-4557-9BD4-0E4F32DE119D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {620DD027-5C7A-4BF7-9F76-44FAC453F5D7} - EndGlobalSection -EndGlobal From 8d9bb261c2a28eb45a098259f3e50247dc4ebe5a Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Oct 2024 07:00:46 -0400 Subject: [PATCH 18/52] fix: nullable information for number types Signed-off-by: Vincent Biret --- .../OpenApiEdmTypeSchemaGenerator.cs | 111 +++++++++--------- .../OpenApiEdmTypeSchemaGeneratorTest.cs | 46 ++++++-- 2 files changed, 92 insertions(+), 65 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs index 510f07a81..bd3b133cc 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs @@ -33,17 +33,17 @@ public static OpenApiSchema CreateEdmTypeSchema(this ODataContext context, IEdmT Utils.CheckArgumentNull(edmTypeReference, nameof(edmTypeReference)); switch (edmTypeReference.TypeKind()) - { - // Collection-valued structural and navigation are represented as Schema Objects of type array. - // The value of the items keyword is a Schema Object specifying the type of the items. + { + // Collection-valued structural and navigation are represented as Schema Objects of type array. + // The value of the items keyword is a Schema Object specifying the type of the items. case EdmTypeKind.Collection: IEdmTypeReference typeRef = edmTypeReference.AsCollection().ElementType(); OpenApiSchema schema; - schema = typeRef.TypeKind() == EdmTypeKind.Complex || typeRef.TypeKind() == EdmTypeKind.Entity - ? context.CreateStructuredTypeSchema(typeRef.AsStructured(), true) - : context.CreateEdmTypeSchema(typeRef); - + schema = typeRef.TypeKind() == EdmTypeKind.Complex || typeRef.TypeKind() == EdmTypeKind.Entity + ? context.CreateStructuredTypeSchema(typeRef.AsStructured(), true) + : context.CreateEdmTypeSchema(typeRef); + return new OpenApiSchema { Type = "array", @@ -133,7 +133,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv } // Nullable properties are marked with the keyword nullable and a value of true. - schema.Nullable = primitiveType.IsNullable ? true : false; + // oneOf and anyOf don't have type, so they can't be set to nullable, entries are nullable + schema.Nullable = schema.AnyOf == null && schema.OneOf == null && primitiveType.IsNullable; } return schema; @@ -182,8 +183,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv { schema.OneOf = new List { - new OpenApiSchema { Type = Constants.NumberType, Format = Constants.DecimalFormat }, - new OpenApiSchema { Type = Constants.StringType }, + new OpenApiSchema { Type = Constants.NumberType, Format = Constants.DecimalFormat, Nullable = true }, + new OpenApiSchema { Type = Constants.StringType, Nullable = true }, }; } else @@ -211,8 +212,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv case EdmPrimitiveTypeKind.Single: // single schema.OneOf = new List { - new OpenApiSchema { Type = Constants.NumberType, Format = "float" }, - new OpenApiSchema { Type = Constants.StringType }, + new OpenApiSchema { Type = Constants.NumberType, Format = "float", Nullable = true }, + new OpenApiSchema { Type = Constants.StringType, Nullable = true }, new OpenApiSchema { UnresolvedReference = true, @@ -246,8 +247,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv { schema.OneOf = new List { - new OpenApiSchema { Type = Constants.IntegerType, Format = Constants.Int64Format }, - new OpenApiSchema { Type = Constants.StringType } + new OpenApiSchema { Type = Constants.IntegerType, Format = Constants.Int64Format, Nullable = true }, + new OpenApiSchema { Type = Constants.StringType, Nullable = true } }; } else @@ -469,47 +470,47 @@ private static OpenApiSchema CreateEnumTypeSchema(this ODataContext context, IEd private static OpenApiSchema CreateStructuredTypeSchema(this ODataContext context, IEdmStructuredTypeReference typeReference, bool isTypeCollection = false) { Debug.Assert(context != null); - Debug.Assert(typeReference != null); - - OpenApiSchema schema = new OpenApiSchema(); - - // AnyOf will only be valid openApi for version 3 - // otherwise the reference should be set directly - // as per OASIS documentation for openApi version 2 - // Collections of structured types cannot be nullable - if (typeReference.IsNullable && !isTypeCollection && - (context.Settings.OpenApiSpecVersion >= OpenApiSpecVersion.OpenApi3_0)) - { - schema.Reference = null; - schema.AnyOf = new List - { - new OpenApiSchema - { - UnresolvedReference = true, - Reference = new OpenApiReference - { - Type = ReferenceType.Schema, - Id = typeReference.Definition.FullTypeName() - } - }, - new OpenApiSchema - { - Type = "object", - Nullable = true - } - }; - } - else - { - schema.Type = null; - schema.AnyOf = null; - schema.Reference = new OpenApiReference - { - Type = ReferenceType.Schema, - Id = typeReference.Definition.FullTypeName() - }; - schema.UnresolvedReference = true; - schema.Nullable = typeReference.IsNullable; + Debug.Assert(typeReference != null); + + OpenApiSchema schema = new OpenApiSchema(); + + // AnyOf will only be valid openApi for version 3 + // otherwise the reference should be set directly + // as per OASIS documentation for openApi version 2 + // Collections of structured types cannot be nullable + if (typeReference.IsNullable && !isTypeCollection && + (context.Settings.OpenApiSpecVersion >= OpenApiSpecVersion.OpenApi3_0)) + { + schema.Reference = null; + schema.AnyOf = new List + { + new OpenApiSchema + { + UnresolvedReference = true, + Reference = new OpenApiReference + { + Type = ReferenceType.Schema, + Id = typeReference.Definition.FullTypeName() + } + }, + new OpenApiSchema + { + Type = "object", + Nullable = true + } + }; + } + else + { + schema.Type = null; + schema.AnyOf = null; + schema.Reference = new OpenApiReference + { + Type = ReferenceType.Schema, + Id = typeReference.Definition.FullTypeName() + }; + schema.UnresolvedReference = true; + schema.Nullable = typeReference.IsNullable; } return schema; diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs index efa5eb6f6..67fea79e2 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs @@ -401,15 +401,20 @@ public void CreateEdmTypeSchemaReturnSchemaForDecimal(bool isNullable, bool IEEE Assert.Null(schema.Type); Assert.NotNull(schema.OneOf); Assert.Equal(2, schema.OneOf.Count); - Assert.Equal(new[] { "number", "string" }, schema.OneOf.Select(a => a.Type)); + var numberSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("number", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(numberSchema); + Assert.True(numberSchema.Nullable); + var stringSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("string", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(stringSchema); + Assert.True(stringSchema.Nullable); + Assert.False(schema.Nullable); } else { Assert.Equal("number", schema.Type); Assert.Null(schema.OneOf); + Assert.Equal(isNullable, schema.Nullable); } - - Assert.Equal(isNullable, schema.Nullable); } [Theory] @@ -439,15 +444,20 @@ public void CreateEdmTypeSchemaReturnSchemaForInt64(bool isNullable, bool IEEE75 Assert.Null(schema.Type); Assert.NotNull(schema.OneOf); Assert.Equal(2, schema.OneOf.Count); - Assert.Equal(new[] { "integer", "string" }, schema.OneOf.Select(a => a.Type)); + var integerSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("integer", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(integerSchema); + Assert.True(integerSchema.Nullable); + var stringSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("string", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(stringSchema); + Assert.True(stringSchema.Nullable); + Assert.False(schema.Nullable); } else { Assert.Equal("integer", schema.Type); Assert.Null(schema.AnyOf); + Assert.Equal(isNullable, schema.Nullable); } - - Assert.Equal(isNullable, schema.Nullable); } [Theory] @@ -502,8 +512,16 @@ public void CreateEdmTypeSchemaReturnSchemaForDouble(bool isNullable) // & Assert Assert.Null(schema.Type); - Assert.Equal("double", schema.OneOf.FirstOrDefault(x => !string.IsNullOrEmpty(x.Format))?.Format); - Assert.Equal(isNullable, schema.Nullable); + var numberSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("number", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(numberSchema); + Assert.True(numberSchema.Nullable); + Assert.Equal("double", numberSchema.Format, StringComparer.OrdinalIgnoreCase); + + var stringSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("string", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(stringSchema); + Assert.True(stringSchema.Nullable); + + Assert.False(schema.Nullable); Assert.Null(schema.AnyOf); @@ -528,8 +546,16 @@ public void CreateEdmTypeSchemaReturnSchemaForSingle(bool isNullable) // & Assert Assert.Null(schema.Type); - Assert.Equal("float", schema.OneOf.FirstOrDefault(x => !string.IsNullOrEmpty(x.Format))?.Format); - Assert.Equal(isNullable, schema.Nullable); + var numberSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("number", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(numberSchema); + Assert.True(numberSchema.Nullable); + Assert.Equal("float", numberSchema.Format, StringComparer.OrdinalIgnoreCase); + + var stringSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("string", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(stringSchema); + Assert.True(stringSchema.Nullable); + + Assert.False(schema.Nullable); Assert.Null(schema.AnyOf); From f4aebd5d633de09a34d692488935e58901d4c2b8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Oct 2024 07:06:28 -0400 Subject: [PATCH 19/52] fix: do not emit integer as it's invalid OAS Signed-off-by: Vincent Biret --- .../Common/Constants.cs | 3 +++ .../OpenApiEdmTypeSchemaGenerator.cs | 12 +++++------ .../OpenApiEdmTypeSchemaGeneratorTest.cs | 14 ++++++------- .../Generator/OpenApiSchemaGeneratorTests.cs | 20 ++++++++++--------- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs b/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs index 2bb9dd774..0c1e2ffa2 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs @@ -3,6 +3,8 @@ // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------ +using System; + namespace Microsoft.OpenApi.OData.Common { /// @@ -168,6 +170,7 @@ internal static class Constants /// /// integer type /// + [Obsolete("integer is not a valid OpenAPI type. Use number instead.")] public static string IntegerType = "integer"; /// diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs index bd3b133cc..5d7087fc4 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs @@ -170,7 +170,7 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv schema.Default = new OpenApiBoolean(false); break; case EdmPrimitiveTypeKind.Byte: // byte - schema.Type = Constants.IntegerType; + schema.Type = Constants.NumberType; schema.Format = "uint8"; break; case EdmPrimitiveTypeKind.DateTimeOffset: // datetime offset @@ -231,13 +231,13 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv schema.Pattern = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"; break; case EdmPrimitiveTypeKind.Int16: - schema.Type = Constants.IntegerType; + schema.Type = Constants.NumberType; schema.Format = "int16"; schema.Minimum = Int16.MinValue; // -32768 schema.Maximum = Int16.MaxValue; // 32767 break; case EdmPrimitiveTypeKind.Int32: - schema.Type = Constants.IntegerType; + schema.Type = Constants.NumberType; schema.Format = "int32"; schema.Minimum = Int32.MinValue; // -2147483648 schema.Maximum = Int32.MaxValue; // 2147483647 @@ -247,18 +247,18 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv { schema.OneOf = new List { - new OpenApiSchema { Type = Constants.IntegerType, Format = Constants.Int64Format, Nullable = true }, + new OpenApiSchema { Type = Constants.NumberType, Format = Constants.Int64Format, Nullable = true }, new OpenApiSchema { Type = Constants.StringType, Nullable = true } }; } else { - schema.Type = Constants.IntegerType; + schema.Type = Constants.NumberType; schema.Format = Constants.Int64Format; } break; case EdmPrimitiveTypeKind.SByte: - schema.Type = Constants.IntegerType; + schema.Type = Constants.NumberType; schema.Format = "int8"; schema.Minimum = SByte.MinValue; // -128 schema.Maximum = SByte.MaxValue; // 127 diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs index 67fea79e2..9dbae3953 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiEdmTypeSchemaGeneratorTest.cs @@ -151,7 +151,7 @@ public void CreateEdmTypeSchemaReturnSchemaForNullableCollectionPrimitiveType() ""items"": { ""maximum"": 2147483647, ""minimum"": -2147483648, - ""type"": ""integer"", + ""type"": ""number"", ""format"": ""int32"", ""nullable"": true } @@ -358,7 +358,7 @@ public void CreateEdmTypeSchemaReturnSchemaForInt32(bool isNullable) Assert.Equal(@"{ ""maximum"": 2147483647, ""minimum"": -2147483648, - ""type"": ""integer"", + ""type"": ""number"", ""format"": ""int32"", ""nullable"": true }".ChangeLineBreaks(), json); @@ -368,7 +368,7 @@ public void CreateEdmTypeSchemaReturnSchemaForInt32(bool isNullable) Assert.Equal(@"{ ""maximum"": 2147483647, ""minimum"": -2147483648, - ""type"": ""integer"", + ""type"": ""number"", ""format"": ""int32"" }".ChangeLineBreaks(), json); } @@ -444,9 +444,9 @@ public void CreateEdmTypeSchemaReturnSchemaForInt64(bool isNullable, bool IEEE75 Assert.Null(schema.Type); Assert.NotNull(schema.OneOf); Assert.Equal(2, schema.OneOf.Count); - var integerSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("integer", StringComparison.OrdinalIgnoreCase)); - Assert.NotNull(integerSchema); - Assert.True(integerSchema.Nullable); + var numberSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("number", StringComparison.OrdinalIgnoreCase)); + Assert.NotNull(numberSchema); + Assert.True(numberSchema.Nullable); var stringSchema = schema.OneOf.FirstOrDefault(x => x.Type.Equals("string", StringComparison.OrdinalIgnoreCase)); Assert.NotNull(stringSchema); Assert.True(stringSchema.Nullable); @@ -454,7 +454,7 @@ public void CreateEdmTypeSchemaReturnSchemaForInt64(bool isNullable, bool IEEE75 } else { - Assert.Equal("integer", schema.Type); + Assert.Equal("number", schema.Type); Assert.Null(schema.AnyOf); Assert.Equal(isNullable, schema.Nullable); } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs index 712b38c2b..de5a38643 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Generator/OpenApiSchemaGeneratorTests.cs @@ -551,10 +551,12 @@ public void CreateComplexTypeWithBaseSchemaReturnCorrectSchema() ""oneOf"": [ { ""type"": ""number"", - ""format"": ""decimal"" + ""format"": ""decimal"", + ""nullable"": true }, { - ""type"": ""string"" + ""type"": ""string"", + ""nullable"": true } ] } @@ -614,7 +616,7 @@ public void CreateEntityTypeWithoutBaseSchemaReturnCorrectSchema() ""Id"": { ""maximum"": 2147483647, ""minimum"": -2147483648, - ""type"": ""integer"", + ""type"": ""number"", ""format"": ""int32"" }, ""Creatures"": { @@ -627,7 +629,7 @@ public void CreateEntityTypeWithoutBaseSchemaReturnCorrectSchema() }, ""description"": ""Entity type 'Zoo' description."", ""example"": { - ""Id"": ""integer (identifier)"", + ""Id"": ""number (identifier)"", ""Creatures"": [ { ""@odata.type"": ""NS.Creature"" @@ -705,8 +707,8 @@ public void CreateEntityTypeWithBaseSchemaReturnCorrectSchema() } ], ""example"": { - ""Id"": ""integer (identifier)"", - ""Age"": ""integer"", + ""Id"": ""number (identifier)"", + ""Age"": ""number"", ""Name"": ""string"" } }" @@ -753,7 +755,7 @@ public void CreateEntityTypeWithCrossReferenceBaseSchemaReturnCorrectSchema() Assert.Single(declaredSchema.Properties); var property = Assert.Single(declaredSchema.Properties); Assert.Equal("Extra", property.Key); - Assert.Equal("integer", property.Value.Type); + Assert.Equal("number", property.Value.Type); Assert.Null(property.Value.OneOf); Assert.Equal("Customer", declaredSchema.Title); @@ -1071,13 +1073,13 @@ public void NonNullableIntegerPropertyWithDefaultValueWorks() // Assert Assert.NotNull(schema); - Assert.Equal("integer", schema.Type); + Assert.Equal("number", schema.Type); string json = schema.SerializeAsJson(OpenApiSpecVersion.OpenApi3_0); Assert.Equal(@"{ ""maximum"": 2147483647, ""minimum"": -2147483648, - ""type"": ""integer"", + ""type"": ""number"", ""format"": ""int32"", ""default"": -128 }".ChangeLineBreaks(), json); From bf2bb5b8bf4445a94982c77d08ae8d7c2bd5f410 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Oct 2024 07:18:12 -0400 Subject: [PATCH 20/52] chore: updates integration tests Signed-off-by: Vincent Biret --- .../Resources/Basic.OpenApi.V2.json | 6 +- .../Resources/Basic.OpenApi.V2.yaml | 6 +- .../Resources/Basic.OpenApi.json | 6 +- .../Resources/Basic.OpenApi.yaml | 6 +- .../Resources/Multiple.Schema.OpenApi.V2.json | 596 +++++++++--------- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 596 +++++++++--------- .../Resources/Multiple.Schema.OpenApi.json | 596 +++++++++--------- .../Resources/Multiple.Schema.OpenApi.yaml | 596 +++++++++--------- .../Resources/TripService.OpenApi.V2.json | 168 ++--- .../Resources/TripService.OpenApi.V2.yaml | 168 ++--- .../Resources/TripService.OpenApi.json | 195 +++--- .../Resources/TripService.OpenApi.yaml | 177 +++--- 12 files changed, 1565 insertions(+), 1551 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json index 217579675..b904fcecd 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.json @@ -974,14 +974,14 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "City": { "$ref": "#/definitions/DefaultNs.City" } }, "example": { - "Id": "integer", + "Id": "number", "City": { "@odata.type": "DefaultNs.City" } @@ -1003,7 +1003,7 @@ } ], "example": { - "Id": "integer", + "Id": "number", "City": { "@odata.type": "DefaultNs.City" }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml index de8441550..272fd865a 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.V2.yaml @@ -641,11 +641,11 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number City: $ref: '#/definitions/DefaultNs.City' example: - Id: integer + Id: number City: '@odata.type': DefaultNs.City DefaultNs.WorkAddress: @@ -657,7 +657,7 @@ definitions: CountryOrRegion: $ref: '#/definitions/DefaultNs.CountryOrRegion' example: - Id: integer + Id: number City: '@odata.type': DefaultNs.City CountryOrRegion: diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json index e7ea0cc51..c3b1db8fb 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.json @@ -1076,7 +1076,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "City": { @@ -1084,7 +1084,7 @@ } }, "example": { - "Id": "integer", + "Id": "number", "City": { "@odata.type": "DefaultNs.City" } @@ -1106,7 +1106,7 @@ } ], "example": { - "Id": "integer", + "Id": "number", "City": { "@odata.type": "DefaultNs.City" }, diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml index c192e98db..be4edfc1e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Basic.OpenApi.yaml @@ -709,12 +709,12 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 City: $ref: '#/components/schemas/DefaultNs.City' example: - Id: integer + Id: number City: '@odata.type': DefaultNs.City DefaultNs.WorkAddress: @@ -726,7 +726,7 @@ components: CountryOrRegion: $ref: '#/components/schemas/DefaultNs.CountryOrRegion' example: - Id: integer + Id: number City: '@odata.type': DefaultNs.City CountryOrRegion: diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 10e4853a6..4f4e94703 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -149,7 +149,7 @@ "name": "Id", "description": "The unique identifier of CategoryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -213,7 +213,7 @@ "name": "Id", "description": "The unique identifier of CategoryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -251,7 +251,7 @@ "name": "Id", "description": "The unique identifier of CategoryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -455,7 +455,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -525,7 +525,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -563,7 +563,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -601,7 +601,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -633,7 +633,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -767,7 +767,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -778,7 +778,7 @@ "name": "Id1", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -816,7 +816,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -853,7 +853,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -942,7 +942,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -974,7 +974,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1019,7 +1019,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1102,7 +1102,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1150,7 +1150,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1198,7 +1198,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1416,7 +1416,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1491,7 +1491,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1529,7 +1529,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1567,7 +1567,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1680,7 +1680,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1691,7 +1691,7 @@ "name": "Id1", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1729,7 +1729,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1740,7 +1740,7 @@ "name": "Id1", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1823,7 +1823,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1834,7 +1834,7 @@ "name": "Id1", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1882,7 +1882,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1893,7 +1893,7 @@ "name": "Id1", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1941,7 +1941,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1952,7 +1952,7 @@ "name": "Id1", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -1989,7 +1989,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2026,7 +2026,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2101,7 +2101,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2133,7 +2133,7 @@ "name": "Id", "description": "The unique identifier of LibraryDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2365,7 +2365,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2442,7 +2442,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2480,7 +2480,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2521,7 +2521,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2638,7 +2638,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2670,7 +2670,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2702,7 +2702,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2740,7 +2740,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2846,7 +2846,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2894,7 +2894,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2942,7 +2942,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -2979,7 +2979,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3084,7 +3084,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3132,7 +3132,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3180,7 +3180,7 @@ "name": "Id", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3383,7 +3383,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3453,7 +3453,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3491,7 +3491,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3529,7 +3529,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3561,7 +3561,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3695,7 +3695,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3706,7 +3706,7 @@ "name": "Id1", "description": "The unique identifier of RevisionDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3744,7 +3744,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3781,7 +3781,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3870,7 +3870,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3902,7 +3902,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -3947,7 +3947,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -4030,7 +4030,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -4078,7 +4078,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -4126,7 +4126,7 @@ "name": "Id", "description": "The unique identifier of DocumentDto", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -4186,7 +4186,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -4207,7 +4207,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModificationDate": { "format": "date-time", @@ -4218,7 +4218,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Tags": { "type": "array", @@ -4235,15 +4235,15 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Description": "string", "Filename": "string", "NumberOfRevisions": "string", "Suffix": "string", - "DomainId": "integer", + "DomainId": "number", "ModificationDate": "string (timestamp)", - "ModifiedBy": "integer", + "ModifiedBy": "number", "Tags": [ { "@odata.type": "Siterra.Documents.App.DTO.DocumentTagRelDto" @@ -4264,7 +4264,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -4279,19 +4279,19 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ParentTypeId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ParentId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "AllowMultiple": { "type": "boolean" @@ -4303,19 +4303,19 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DomainId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreationDate": { "format": "date-time", @@ -4326,7 +4326,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModificationDate": { "format": "date-time", @@ -4342,20 +4342,20 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Number": "string", "Description": "string", - "LibraryTemplateId": "integer", - "ParentTypeId": "integer", - "ParentId": "integer", + "LibraryTemplateId": "number", + "ParentTypeId": "number", + "ParentId": "number", "AllowMultiple": true, "AutoCreate": true, - "TypeId": "integer", - "DomainId": "integer", - "CreatedBy": "integer", + "TypeId": "number", + "DomainId": "number", + "CreatedBy": "number", "CreationDate": "string (timestamp)", - "ModifiedBy": "integer", + "ModifiedBy": "number", "ModificationDate": "string (timestamp)", "Documents": [ { @@ -4372,19 +4372,19 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Number": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DocumentId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DocumentName": { "type": "string" @@ -4401,7 +4401,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsReviewed": { "type": "boolean" @@ -4410,7 +4410,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ReviewedDate": { "format": "date-time", @@ -4424,7 +4424,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ApprovedDate": { "format": "date-time", @@ -4438,7 +4438,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "RejectedDate": { "format": "date-time", @@ -4449,30 +4449,30 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Document": { "$ref": "#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document" } }, "example": { - "Id": "integer (identifier)", - "Number": "integer", - "DocumentId": "integer", + "Id": "number (identifier)", + "Number": "number", + "DocumentId": "number", "DocumentName": "string", "DocumentDescription": "string", "CreationDate": "string (timestamp)", - "CreatedBy": "integer", + "CreatedBy": "number", "IsReviewed": true, - "ReviewedBy": "integer", + "ReviewedBy": "number", "ReviewedDate": "string (timestamp)", "IsApproved": true, - "ApprovedBy": "integer", + "ApprovedBy": "number", "ApprovedDate": "string (timestamp)", "IsRejected": true, - "RejectedBy": "integer", + "RejectedBy": "number", "RejectedDate": "string (timestamp)", - "DomainId": "integer", + "DomainId": "number", "Document": { "@odata.type": "Siterra.Documents.BusinessLogic.Entities.Document.Document" } @@ -4486,7 +4486,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -4508,16 +4508,16 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Description": "string", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", - "DomainId": "integer" + "DomainId": "number" } }, "Siterra.Documents.App.DTO.DocumentTagRelDto": { @@ -4540,7 +4540,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -4552,13 +4552,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "TypeId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Keywords": { "type": "string" @@ -4572,7 +4572,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModificationDate": { "format": "date-time", @@ -4583,25 +4583,25 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DomainId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "LibraryId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "OwnerUserId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "StatusDate": { "format": "date-time", @@ -4612,7 +4612,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CheckoutDate": { "format": "date-time", @@ -4626,7 +4626,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Number": { "type": "string" @@ -4647,13 +4647,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsDeleted": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsNa": { "format": "decimal", @@ -4686,13 +4686,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ScraperMapId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "LastDownloadedDate": { "format": "date-time", @@ -4703,13 +4703,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsApprovedOld": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Suffix": { "type": "string" @@ -4718,7 +4718,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsApproved": { "format": "decimal", @@ -4728,19 +4728,19 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "SectionId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "VersionCount": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "LastFileName": { "type": "string" @@ -4782,30 +4782,30 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Description": "string", - "StatusId": "integer", - "TypeId": "integer", + "StatusId": "number", + "TypeId": "number", "Keywords": "string", "CreationDate": "string (timestamp)", - "CreatedBy": "integer", + "CreatedBy": "number", "ModificationDate": "string (timestamp)", - "ModifiedBy": "integer", - "DomainId": "integer", - "LibraryId": "integer", - "OwnerUserId": "integer", + "ModifiedBy": "number", + "DomainId": "number", + "LibraryId": "number", + "OwnerUserId": "number", "StatusDate": "string (timestamp)", - "LastRevisionId": "integer", + "LastRevisionId": "number", "CheckoutDate": "string (timestamp)", "CheckoutPath": "string", - "CheckoutUserId": "integer", + "CheckoutUserId": "number", "Number": "string", "OriginalDate": "string (timestamp)", "FileSized": "number", "FileClientPath": "string", - "LastRevisionFileId": "integer", - "IsDeleted": "integer", + "LastRevisionFileId": "number", + "IsDeleted": "number", "IsNa": "number", "IsRejected": "number", "IsReviewed": "number", @@ -4814,17 +4814,17 @@ "RejectedDescription": "string", "RejectedReason": "string", "ReviewDescription": "string", - "SourceDocumentId": "integer", - "ScraperMapId": "integer", + "SourceDocumentId": "number", + "ScraperMapId": "number", "LastDownloadedDate": "string (timestamp)", - "SmsId": "integer", - "IsApprovedOld": "integer", + "SmsId": "number", + "IsApprovedOld": "number", "Suffix": "string", - "ScrapeResultId": "integer", + "ScrapeResultId": "number", "IsApproved": "number", - "CategoryId": "integer", - "SectionId": "integer", - "VersionCount": "integer", + "CategoryId": "number", + "SectionId": "number", + "VersionCount": "number", "LastFileName": "string", "DocumentClasses": [ { @@ -4865,25 +4865,25 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ClassId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DocumentId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreationDate": { "format": "date-time", @@ -4894,7 +4894,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModificationDate": { "format": "date-time", @@ -4909,12 +4909,12 @@ } }, "example": { - "ClassInstance": "integer", - "ClassId": "integer", - "DocumentId": "integer", - "CreatedBy": "integer", + "ClassInstance": "number", + "ClassId": "number", + "DocumentId": "number", + "CreatedBy": "number", "CreationDate": "string (timestamp)", - "ModifiedBy": "integer", + "ModifiedBy": "number", "ModificationDate": "string (timestamp)", "IsPrimary": true, "Document": { @@ -4930,31 +4930,31 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "TagId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DomainId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModifiedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreationDate": { "format": "date-time", @@ -4974,11 +4974,11 @@ } }, "example": { - "DocumentId": "integer", - "TagId": "integer", - "DomainId": "integer", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "DocumentId": "number", + "TagId": "number", + "DomainId": "number", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Document": { @@ -4997,13 +4997,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DomainId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -5012,7 +5012,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Number": { "type": "string" @@ -5021,13 +5021,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "OwnerUserId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "TotalSize": { "format": "decimal", @@ -5037,13 +5037,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "FoldersCounter": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreationDate": { "format": "date-time", @@ -5059,37 +5059,37 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ProjectId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "SearchRingId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "SiteId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "AssetId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "AllowMultiple": { "type": "boolean" @@ -5107,25 +5107,25 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "SourceFolderId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "TemplateClassId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "TemplateSubType": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsHidden": { "type": "boolean" @@ -5134,61 +5134,61 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "StatusId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "SmsId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ContractId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "VendorId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "OrganizationUnitId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IncidentId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "EventId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ClassInstance": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ClassId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "LibraryParent": { "$ref": "#/definitions/Siterra.Documents.BusinessLogic.Entities.Library.Library" @@ -5222,43 +5222,43 @@ } }, "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", - "ParentFolderId": "integer", + "ParentFolderId": "number", "Number": "string", - "TypeId": "integer", - "OwnerUserId": "integer", + "TypeId": "number", + "OwnerUserId": "number", "TotalSize": "number", - "FilesCounter": "integer", - "FoldersCounter": "integer", + "FilesCounter": "number", + "FoldersCounter": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", - "ModifiedBy": "integer", - "CreatedBy": "integer", - "ProjectId": "integer", - "SearchRingId": "integer", - "SiteId": "integer", - "AssetId": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", + "ProjectId": "number", + "SearchRingId": "number", + "SiteId": "number", + "AssetId": "number", "AllowMultiple": true, "AutoCreate": true, "Description": "string", "IsTemplate": true, - "ProgramId": "integer", - "SourceFolderId": "integer", - "TemplateClassId": "integer", - "TemplateSubType": "integer", + "ProgramId": "number", + "SourceFolderId": "number", + "TemplateClassId": "number", + "TemplateSubType": "number", "IsHidden": true, - "IsDeleted": "integer", - "StatusId": "integer", - "SmsId": "integer", - "ContractId": "integer", - "VendorId": "integer", - "OrganizationUnitId": "integer", - "IncidentId": "integer", - "EventId": "integer", - "ClassInstance": "integer", - "ClassId": "integer", + "IsDeleted": "number", + "StatusId": "number", + "SmsId": "number", + "ContractId": "number", + "VendorId": "number", + "OrganizationUnitId": "number", + "IncidentId": "number", + "EventId": "number", + "ClassInstance": "number", + "ClassId": "number", "LibraryParent": { "@odata.type": "Siterra.Documents.BusinessLogic.Entities.Library.Library" }, @@ -5293,7 +5293,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -5302,13 +5302,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModificationDate": { "format": "date-time", @@ -5324,7 +5324,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Description": { "type": "string" @@ -5336,25 +5336,25 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Number": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ClassId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ParentId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "HasChanged": { "type": "boolean" @@ -5381,19 +5381,19 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", - "ModifiedBy": "integer", - "CreatedBy": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", "ModificationDate": "string (timestamp)", "CreationDate": "string (timestamp)", - "DomainId": "integer", + "DomainId": "number", "Description": "string", "XmlName": "string", - "MasterId": "integer", - "Number": "integer", - "ClassId": "integer", - "ParentId": "integer", + "MasterId": "number", + "Number": "number", + "ClassId": "number", + "ParentId": "number", "HasChanged": true, "MasterLibraryType": { "@odata.type": "Siterra.Documents.BusinessLogic.Entities.Library.LibraryType" @@ -5421,7 +5421,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -5433,13 +5433,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreationDate": { "format": "date-time", @@ -5462,19 +5462,19 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "SourceClassId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ContentTypeId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ClientPath": { "type": "string" @@ -5483,13 +5483,13 @@ "format": "int16", "maximum": 32767, "minimum": -32768, - "type": "integer" + "type": "number" }, "SmsId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Latitude": { "format": "decimal", @@ -5508,21 +5508,21 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Path": "string", - "ModifiedBy": "integer", - "CreatedBy": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Sized": "number", "ActualName": "string", - "DomainId": "integer", - "SourceClassId": "integer", - "ContentTypeId": "integer", + "DomainId": "number", + "SourceClassId": "number", + "ContentTypeId": "number", "ClientPath": "string", - "IsSelfHosted": "integer", - "SmsId": "integer", + "IsSelfHosted": "number", + "SmsId": "number", "Latitude": "number", "Longitude": "number", "Documents": [ @@ -5540,13 +5540,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DomainId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Name": { "type": "string" @@ -5558,13 +5558,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModifiedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreationDate": { "format": "date-time", @@ -5578,12 +5578,12 @@ } }, "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)" } @@ -5607,12 +5607,12 @@ } ], "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Documents": [ @@ -5642,12 +5642,12 @@ } ], "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Documents": [ @@ -5677,12 +5677,12 @@ } ], "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Documents": [ @@ -5700,19 +5700,19 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Number": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DocumentId": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ModificationDate": { "format": "date-time", @@ -5728,13 +5728,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "CreatedBy": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "Remarks": { "type": "string" @@ -5743,13 +5743,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DocumentOwnerContact": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "DocumentDescription": { "type": "string" @@ -5781,13 +5781,13 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsDeleted": { "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsReviewed": { "type": "boolean" @@ -5799,7 +5799,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsRejected": { "type": "boolean" @@ -5814,7 +5814,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "IsApproved": { "type": "boolean" @@ -5823,7 +5823,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ReviewedDate": { "format": "date-time", @@ -5845,16 +5845,16 @@ } }, "example": { - "Id": "integer (identifier)", - "Number": "integer", - "DocumentId": "integer", + "Id": "number (identifier)", + "Number": "number", + "DocumentId": "number", "ModificationDate": "string (timestamp)", "CreationDate": "string (timestamp)", - "ModifiedBy": "integer", - "CreatedBy": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", "Remarks": "string", - "FileId": "integer", - "DocumentOwnerContact": "integer", + "FileId": "number", + "DocumentOwnerContact": "number", "DocumentDescription": "string", "DocumentStatusDate": "string (timestamp)", "DocumentFolder": "string", @@ -5863,17 +5863,17 @@ "DocumentType": "string", "DocumentName": "string", "DocumentNumber": "string", - "DomainId": "integer", - "IsDeleted": "integer", + "DomainId": "number", + "IsDeleted": "number", "IsReviewed": true, "ReviewDescription": "string", - "ReviewedBy": "integer", + "ReviewedBy": "number", "IsRejected": true, "RejectedReason": "string", "RejectedDescription": "string", - "RejectedBy": "integer", + "RejectedBy": "number", "IsApproved": true, - "ApprovedBy": "integer", + "ApprovedBy": "number", "ReviewedDate": "string (timestamp)", "RejectedDate": "string (timestamp)", "ApprovedDate": "string (timestamp)", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index 2f7e0c2c5..25b673107 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -102,7 +102,7 @@ paths: name: Id description: The unique identifier of CategoryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -148,7 +148,7 @@ paths: name: Id description: The unique identifier of CategoryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -175,7 +175,7 @@ paths: name: Id description: The unique identifier of CategoryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -315,7 +315,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -367,7 +367,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -394,7 +394,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -421,7 +421,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -444,7 +444,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -547,7 +547,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -556,7 +556,7 @@ paths: name: Id1 description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -583,7 +583,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -607,7 +607,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -674,7 +674,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -696,7 +696,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -728,7 +728,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -780,7 +780,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -813,7 +813,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -846,7 +846,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -998,7 +998,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1055,7 +1055,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1082,7 +1082,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1109,7 +1109,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1191,7 +1191,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1200,7 +1200,7 @@ paths: name: Id1 description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1227,7 +1227,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1236,7 +1236,7 @@ paths: name: Id1 description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1288,7 +1288,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1297,7 +1297,7 @@ paths: name: Id1 description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1330,7 +1330,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1339,7 +1339,7 @@ paths: name: Id1 description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1372,7 +1372,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1381,7 +1381,7 @@ paths: name: Id1 description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1405,7 +1405,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1429,7 +1429,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1482,7 +1482,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1504,7 +1504,7 @@ paths: name: Id description: The unique identifier of LibraryDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1670,7 +1670,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1729,7 +1729,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1756,7 +1756,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1785,7 +1785,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1883,7 +1883,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1906,7 +1906,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1928,7 +1928,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -1955,7 +1955,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2030,7 +2030,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2063,7 +2063,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2096,7 +2096,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2120,7 +2120,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2194,7 +2194,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2227,7 +2227,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2260,7 +2260,7 @@ paths: name: Id description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2397,7 +2397,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2449,7 +2449,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2476,7 +2476,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2503,7 +2503,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2526,7 +2526,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2629,7 +2629,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2638,7 +2638,7 @@ paths: name: Id1 description: The unique identifier of RevisionDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2665,7 +2665,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2689,7 +2689,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2756,7 +2756,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2778,7 +2778,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2810,7 +2810,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2862,7 +2862,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2895,7 +2895,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2928,7 +2928,7 @@ paths: name: Id description: The unique identifier of DocumentDto required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -2965,7 +2965,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string Description: @@ -2980,7 +2980,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModificationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -2989,7 +2989,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Tags: type: array items: @@ -3000,15 +3000,15 @@ definitions: $ref: '#/definitions/Siterra.Documents.App.DTO.RevisionDto' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Description: string Filename: string NumberOfRevisions: string Suffix: string - DomainId: integer + DomainId: number ModificationDate: string (timestamp) - ModifiedBy: integer + ModifiedBy: number Tags: - '@odata.type': Siterra.Documents.App.DTO.DocumentTagRelDto Revisions: @@ -3021,7 +3021,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string Number: @@ -3032,17 +3032,17 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ParentTypeId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ParentId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number AllowMultiple: type: boolean AutoCreate: @@ -3051,17 +3051,17 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DomainId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3070,7 +3070,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModificationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3081,20 +3081,20 @@ definitions: $ref: '#/definitions/Siterra.Documents.App.DTO.DocumentDto' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Number: string Description: string - LibraryTemplateId: integer - ParentTypeId: integer - ParentId: integer + LibraryTemplateId: number + ParentTypeId: number + ParentId: number AllowMultiple: true AutoCreate: true - TypeId: integer - DomainId: integer - CreatedBy: integer + TypeId: number + DomainId: number + CreatedBy: number CreationDate: string (timestamp) - ModifiedBy: integer + ModifiedBy: number ModificationDate: string (timestamp) Documents: - '@odata.type': Siterra.Documents.App.DTO.DocumentDto @@ -3106,17 +3106,17 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Number: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DocumentId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DocumentName: type: string DocumentDescription: @@ -3129,14 +3129,14 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsReviewed: type: boolean ReviewedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ReviewedDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3147,7 +3147,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ApprovedDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3158,7 +3158,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number RejectedDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3167,27 +3167,27 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Document: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document' example: - Id: integer (identifier) - Number: integer - DocumentId: integer + Id: number (identifier) + Number: number + DocumentId: number DocumentName: string DocumentDescription: string CreationDate: string (timestamp) - CreatedBy: integer + CreatedBy: number IsReviewed: true - ReviewedBy: integer + ReviewedBy: number ReviewedDate: string (timestamp) IsApproved: true - ApprovedBy: integer + ApprovedBy: number ApprovedDate: string (timestamp) IsRejected: true - RejectedBy: integer + RejectedBy: number RejectedDate: string (timestamp) - DomainId: integer + DomainId: number Document: '@odata.type': Siterra.Documents.BusinessLogic.Entities.Document.Document Siterra.Documents.App.DTO.CategoryDto: @@ -3198,7 +3198,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string Description: @@ -3215,14 +3215,14 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number example: - Id: integer (identifier) + Id: number (identifier) Name: string Description: string CreationDate: string (timestamp) ModificationDate: string (timestamp) - DomainId: integer + DomainId: number Siterra.Documents.App.DTO.DocumentTagRelDto: title: DocumentTagRelDto type: object @@ -3239,7 +3239,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string Description: @@ -3248,12 +3248,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number TypeId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Keywords: type: string CreationDate: @@ -3264,7 +3264,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModificationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3273,22 +3273,22 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DomainId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number LibraryId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number OwnerUserId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number StatusDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3297,7 +3297,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CheckoutDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3308,7 +3308,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Number: type: string OriginalDate: @@ -3324,12 +3324,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsDeleted: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsNa: format: decimal type: number @@ -3353,12 +3353,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ScraperMapId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number LastDownloadedDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3367,19 +3367,19 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsApprovedOld: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Suffix: type: string ScrapeResultId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsApproved: format: decimal type: number @@ -3387,17 +3387,17 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number SectionId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number VersionCount: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number LastFileName: type: string DocumentClasses: @@ -3425,30 +3425,30 @@ definitions: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Revision.Revision' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Description: string - StatusId: integer - TypeId: integer + StatusId: number + TypeId: number Keywords: string CreationDate: string (timestamp) - CreatedBy: integer + CreatedBy: number ModificationDate: string (timestamp) - ModifiedBy: integer - DomainId: integer - LibraryId: integer - OwnerUserId: integer + ModifiedBy: number + DomainId: number + LibraryId: number + OwnerUserId: number StatusDate: string (timestamp) - LastRevisionId: integer + LastRevisionId: number CheckoutDate: string (timestamp) CheckoutPath: string - CheckoutUserId: integer + CheckoutUserId: number Number: string OriginalDate: string (timestamp) FileSized: number FileClientPath: string - LastRevisionFileId: integer - IsDeleted: integer + LastRevisionFileId: number + IsDeleted: number IsNa: number IsRejected: number IsReviewed: number @@ -3457,17 +3457,17 @@ definitions: RejectedDescription: string RejectedReason: string ReviewDescription: string - SourceDocumentId: integer - ScraperMapId: integer + SourceDocumentId: number + ScraperMapId: number LastDownloadedDate: string (timestamp) - SmsId: integer - IsApprovedOld: integer + SmsId: number + IsApprovedOld: number Suffix: string - ScrapeResultId: integer + ScrapeResultId: number IsApproved: number - CategoryId: integer - SectionId: integer - VersionCount: integer + CategoryId: number + SectionId: number + VersionCount: number LastFileName: string DocumentClasses: - '@odata.type': Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass @@ -3491,22 +3491,22 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ClassId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DocumentId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3515,7 +3515,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModificationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3525,12 +3525,12 @@ definitions: Document: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document' example: - ClassInstance: integer - ClassId: integer - DocumentId: integer - CreatedBy: integer + ClassInstance: number + ClassId: number + DocumentId: number + CreatedBy: number CreationDate: string (timestamp) - ModifiedBy: integer + ModifiedBy: number ModificationDate: string (timestamp) IsPrimary: true Document: @@ -3543,27 +3543,27 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number TagId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DomainId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModifiedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3577,11 +3577,11 @@ definitions: Tag: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Tags.Tag' example: - DocumentId: integer - TagId: integer - DomainId: integer - CreatedBy: integer - ModifiedBy: integer + DocumentId: number + TagId: number + DomainId: number + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Document: @@ -3596,31 +3596,31 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DomainId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string ParentFolderId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Number: type: string TypeId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number OwnerUserId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number TotalSize: format: decimal type: number @@ -3628,12 +3628,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number FoldersCounter: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3646,32 +3646,32 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ProjectId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number SearchRingId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number SiteId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number AssetId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number AllowMultiple: type: boolean AutoCreate: @@ -3684,74 +3684,74 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number SourceFolderId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number TemplateClassId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number TemplateSubType: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsHidden: type: boolean IsDeleted: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number StatusId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number SmsId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ContractId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number VendorId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number OrganizationUnitId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IncidentId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number EventId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ClassInstance: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ClassId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number LibraryParent: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Library.Library' Type: @@ -3774,43 +3774,43 @@ definitions: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Library.Library' x-ms-navigationProperty: true example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string - ParentFolderId: integer + ParentFolderId: number Number: string - TypeId: integer - OwnerUserId: integer + TypeId: number + OwnerUserId: number TotalSize: number - FilesCounter: integer - FoldersCounter: integer + FilesCounter: number + FoldersCounter: number CreationDate: string (timestamp) ModificationDate: string (timestamp) - ModifiedBy: integer - CreatedBy: integer - ProjectId: integer - SearchRingId: integer - SiteId: integer - AssetId: integer + ModifiedBy: number + CreatedBy: number + ProjectId: number + SearchRingId: number + SiteId: number + AssetId: number AllowMultiple: true AutoCreate: true Description: string IsTemplate: true - ProgramId: integer - SourceFolderId: integer - TemplateClassId: integer - TemplateSubType: integer + ProgramId: number + SourceFolderId: number + TemplateClassId: number + TemplateSubType: number IsHidden: true - IsDeleted: integer - StatusId: integer - SmsId: integer - ContractId: integer - VendorId: integer - OrganizationUnitId: integer - IncidentId: integer - EventId: integer - ClassInstance: integer - ClassId: integer + IsDeleted: number + StatusId: number + SmsId: number + ContractId: number + VendorId: number + OrganizationUnitId: number + IncidentId: number + EventId: number + ClassInstance: number + ClassId: number LibraryParent: '@odata.type': Siterra.Documents.BusinessLogic.Entities.Library.Library Type: @@ -3831,19 +3831,19 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string ModifiedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModificationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3856,7 +3856,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Description: type: string XmlName: @@ -3865,22 +3865,22 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Number: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ClassId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ParentId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number HasChanged: type: boolean MasterLibraryType: @@ -3898,19 +3898,19 @@ definitions: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string - ModifiedBy: integer - CreatedBy: integer + ModifiedBy: number + CreatedBy: number ModificationDate: string (timestamp) CreationDate: string (timestamp) - DomainId: integer + DomainId: number Description: string XmlName: string - MasterId: integer - Number: integer - ClassId: integer - ParentId: integer + MasterId: number + Number: number + ClassId: number + ParentId: number HasChanged: true MasterLibraryType: '@odata.type': Siterra.Documents.BusinessLogic.Entities.Library.LibraryType @@ -3928,7 +3928,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string Path: @@ -3937,12 +3937,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3960,29 +3960,29 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number SourceClassId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ContentTypeId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ClientPath: type: string IsSelfHosted: format: int16 maximum: 32767 minimum: -32768 - type: integer + type: number SmsId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Latitude: format: decimal type: number @@ -3995,21 +3995,21 @@ definitions: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Path: string - ModifiedBy: integer - CreatedBy: integer + ModifiedBy: number + CreatedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Sized: number ActualName: string - DomainId: integer - SourceClassId: integer - ContentTypeId: integer + DomainId: number + SourceClassId: number + ContentTypeId: number ClientPath: string - IsSelfHosted: integer - SmsId: integer + IsSelfHosted: number + SmsId: number Latitude: number Longitude: number Documents: @@ -4022,12 +4022,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DomainId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Name: type: string Description: @@ -4036,12 +4036,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModifiedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4051,12 +4051,12 @@ definitions: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' type: string example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Siterra.Documents.BusinessLogic.Entities.Tags.UserDefinedTag: @@ -4070,12 +4070,12 @@ definitions: items: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel' example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Documents: @@ -4092,12 +4092,12 @@ definitions: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document' x-ms-navigationProperty: true example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Documents: @@ -4114,12 +4114,12 @@ definitions: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document' x-ms-navigationProperty: true example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Documents: @@ -4132,17 +4132,17 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Number: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DocumentId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ModificationDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4155,24 +4155,24 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number CreatedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number Remarks: type: string FileId: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DocumentOwnerContact: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number DocumentDescription: type: string DocumentStatusDate: @@ -4195,12 +4195,12 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsDeleted: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsReviewed: type: boolean ReviewDescription: @@ -4209,7 +4209,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsRejected: type: boolean RejectedReason: @@ -4220,14 +4220,14 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number IsApproved: type: boolean ApprovedBy: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ReviewedDate: format: date-time pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4243,16 +4243,16 @@ definitions: Document: $ref: '#/definitions/Siterra.Documents.BusinessLogic.Entities.Document.Document' example: - Id: integer (identifier) - Number: integer - DocumentId: integer + Id: number (identifier) + Number: number + DocumentId: number ModificationDate: string (timestamp) CreationDate: string (timestamp) - ModifiedBy: integer - CreatedBy: integer + ModifiedBy: number + CreatedBy: number Remarks: string - FileId: integer - DocumentOwnerContact: integer + FileId: number + DocumentOwnerContact: number DocumentDescription: string DocumentStatusDate: string (timestamp) DocumentFolder: string @@ -4261,17 +4261,17 @@ definitions: DocumentType: string DocumentName: string DocumentNumber: string - DomainId: integer - IsDeleted: integer + DomainId: number + IsDeleted: number IsReviewed: true ReviewDescription: string - ReviewedBy: integer + ReviewedBy: number IsRejected: true RejectedReason: string RejectedDescription: string - RejectedBy: integer + RejectedBy: number IsApproved: true - ApprovedBy: integer + ApprovedBy: number ReviewedDate: string (timestamp) RejectedDate: string (timestamp) ApprovedDate: string (timestamp) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index abb6b1b9d..a688f6202 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -164,7 +164,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "CategoryDto" @@ -241,7 +241,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "CategoryDto" @@ -283,7 +283,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "CategoryDto" @@ -501,7 +501,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -592,7 +592,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -634,7 +634,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -676,7 +676,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -710,7 +710,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -861,7 +861,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -874,7 +874,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -916,7 +916,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -955,7 +955,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1051,7 +1051,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1085,7 +1085,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1135,7 +1135,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1232,7 +1232,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1281,7 +1281,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1336,7 +1336,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1566,7 +1566,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -1659,7 +1659,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -1701,7 +1701,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -1743,7 +1743,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -1873,7 +1873,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -1886,7 +1886,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -1927,7 +1927,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -1940,7 +1940,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -2037,7 +2037,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2050,7 +2050,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -2099,7 +2099,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2112,7 +2112,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -2167,7 +2167,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2180,7 +2180,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -2219,7 +2219,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2258,7 +2258,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2340,7 +2340,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2374,7 +2374,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "LibraryDto" @@ -2622,7 +2622,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -2717,7 +2717,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -2759,7 +2759,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -2801,7 +2801,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -2948,7 +2948,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3003,7 +3003,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3037,7 +3037,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3078,7 +3078,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3198,7 +3198,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3247,7 +3247,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3302,7 +3302,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3340,7 +3340,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3459,7 +3459,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3508,7 +3508,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3563,7 +3563,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -3778,7 +3778,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -3869,7 +3869,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -3911,7 +3911,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -3953,7 +3953,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -3987,7 +3987,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4138,7 +4138,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4151,7 +4151,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "RevisionDto" @@ -4193,7 +4193,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4232,7 +4232,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4328,7 +4328,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4362,7 +4362,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4412,7 +4412,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4509,7 +4509,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4558,7 +4558,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4613,7 +4613,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "DocumentDto" @@ -4671,7 +4671,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -4697,7 +4697,7 @@ "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ModificationDate": { @@ -4709,7 +4709,7 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -4728,15 +4728,15 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Description": "string", "Filename": "string", "NumberOfRevisions": "string", "Suffix": "string", - "DomainId": "integer", + "DomainId": "number", "ModificationDate": "string (timestamp)", - "ModifiedBy": "integer", + "ModifiedBy": "number", "Tags": [ { "@odata.type": "Siterra.Documents.App.DTO.DocumentTagRelDto" @@ -4756,7 +4756,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -4774,20 +4774,20 @@ "LibraryTemplateId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "ParentTypeId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ParentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "AllowMultiple": { @@ -4799,19 +4799,19 @@ "TypeId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreationDate": { @@ -4822,7 +4822,7 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -4841,20 +4841,20 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Number": "string", "Description": "string", - "LibraryTemplateId": "integer", - "ParentTypeId": "integer", - "ParentId": "integer", + "LibraryTemplateId": "number", + "ParentTypeId": "number", + "ParentId": "number", "AllowMultiple": true, "AutoCreate": true, - "TypeId": "integer", - "DomainId": "integer", - "CreatedBy": "integer", + "TypeId": "number", + "DomainId": "number", + "CreatedBy": "number", "CreationDate": "string (timestamp)", - "ModifiedBy": "integer", + "ModifiedBy": "number", "ModificationDate": "string (timestamp)", "Documents": [ { @@ -4870,19 +4870,19 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Number": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DocumentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -4902,7 +4902,7 @@ "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "IsReviewed": { @@ -4911,7 +4911,7 @@ "ReviewedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -4927,7 +4927,7 @@ "ApprovedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -4943,7 +4943,7 @@ "RejectedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -4956,7 +4956,7 @@ "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Document": { @@ -4973,23 +4973,23 @@ } }, "example": { - "Id": "integer (identifier)", - "Number": "integer", - "DocumentId": "integer", + "Id": "number (identifier)", + "Number": "number", + "DocumentId": "number", "DocumentName": "string", "DocumentDescription": "string", "CreationDate": "string (timestamp)", - "CreatedBy": "integer", + "CreatedBy": "number", "IsReviewed": true, - "ReviewedBy": "integer", + "ReviewedBy": "number", "ReviewedDate": "string (timestamp)", "IsApproved": true, - "ApprovedBy": "integer", + "ApprovedBy": "number", "ApprovedDate": "string (timestamp)", "IsRejected": true, - "RejectedBy": "integer", + "RejectedBy": "number", "RejectedDate": "string (timestamp)", - "DomainId": "integer", + "DomainId": "number", "Document": { "@odata.type": "Siterra.Documents.BusinessLogic.Entities.Document.Document" } @@ -5002,7 +5002,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -5026,17 +5026,17 @@ "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Description": "string", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", - "DomainId": "integer" + "DomainId": "number" } }, "Siterra.Documents.App.DTO.DocumentTagRelDto": { @@ -5059,7 +5059,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -5073,13 +5073,13 @@ "StatusId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "TypeId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Keywords": { @@ -5094,7 +5094,7 @@ "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ModificationDate": { @@ -5105,26 +5105,26 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "LibraryId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "OwnerUserId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "StatusDate": { @@ -5135,7 +5135,7 @@ "LastRevisionId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5152,7 +5152,7 @@ "CheckoutUserId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5177,14 +5177,14 @@ "LastRevisionFileId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "IsDeleted": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "IsNa": { @@ -5225,14 +5225,14 @@ "SourceDocumentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "ScraperMapId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5245,14 +5245,14 @@ "SmsId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "IsApprovedOld": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5263,7 +5263,7 @@ "ScrapeResultId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5275,21 +5275,21 @@ "CategoryId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "SectionId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "VersionCount": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "LastFileName": { @@ -5360,30 +5360,30 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Description": "string", - "StatusId": "integer", - "TypeId": "integer", + "StatusId": "number", + "TypeId": "number", "Keywords": "string", "CreationDate": "string (timestamp)", - "CreatedBy": "integer", + "CreatedBy": "number", "ModificationDate": "string (timestamp)", - "ModifiedBy": "integer", - "DomainId": "integer", - "LibraryId": "integer", - "OwnerUserId": "integer", + "ModifiedBy": "number", + "DomainId": "number", + "LibraryId": "number", + "OwnerUserId": "number", "StatusDate": "string (timestamp)", - "LastRevisionId": "integer", + "LastRevisionId": "number", "CheckoutDate": "string (timestamp)", "CheckoutPath": "string", - "CheckoutUserId": "integer", + "CheckoutUserId": "number", "Number": "string", "OriginalDate": "string (timestamp)", "FileSized": "number", "FileClientPath": "string", - "LastRevisionFileId": "integer", - "IsDeleted": "integer", + "LastRevisionFileId": "number", + "IsDeleted": "number", "IsNa": "number", "IsRejected": "number", "IsReviewed": "number", @@ -5392,17 +5392,17 @@ "RejectedDescription": "string", "RejectedReason": "string", "ReviewDescription": "string", - "SourceDocumentId": "integer", - "ScraperMapId": "integer", + "SourceDocumentId": "number", + "ScraperMapId": "number", "LastDownloadedDate": "string (timestamp)", - "SmsId": "integer", - "IsApprovedOld": "integer", + "SmsId": "number", + "IsApprovedOld": "number", "Suffix": "string", - "ScrapeResultId": "integer", + "ScrapeResultId": "number", "IsApproved": "number", - "CategoryId": "integer", - "SectionId": "integer", - "VersionCount": "integer", + "CategoryId": "number", + "SectionId": "number", + "VersionCount": "number", "LastFileName": "string", "DocumentClasses": [ { @@ -5442,25 +5442,25 @@ "ClassInstance": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ClassId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DocumentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreationDate": { @@ -5471,7 +5471,7 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ModificationDate": { @@ -5496,12 +5496,12 @@ } }, "example": { - "ClassInstance": "integer", - "ClassId": "integer", - "DocumentId": "integer", - "CreatedBy": "integer", + "ClassInstance": "number", + "ClassId": "number", + "DocumentId": "number", + "CreatedBy": "number", "CreationDate": "string (timestamp)", - "ModifiedBy": "integer", + "ModifiedBy": "number", "ModificationDate": "string (timestamp)", "IsPrimary": true, "Document": { @@ -5516,31 +5516,31 @@ "DocumentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "TagId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreationDate": { @@ -5579,11 +5579,11 @@ } }, "example": { - "DocumentId": "integer", - "TagId": "integer", - "DomainId": "integer", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "DocumentId": "number", + "TagId": "number", + "DomainId": "number", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Document": { @@ -5601,13 +5601,13 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -5617,7 +5617,7 @@ "ParentFolderId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5628,13 +5628,13 @@ "TypeId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "OwnerUserId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "TotalSize": { @@ -5644,13 +5644,13 @@ "FilesCounter": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "FoldersCounter": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreationDate": { @@ -5666,40 +5666,40 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ProjectId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "SearchRingId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "SiteId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "AssetId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5719,28 +5719,28 @@ "ProgramId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "SourceFolderId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "TemplateClassId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "TemplateSubType": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5750,68 +5750,68 @@ "IsDeleted": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "StatusId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "SmsId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "ContractId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "VendorId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "OrganizationUnitId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "IncidentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "EventId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "ClassInstance": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ClassId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "LibraryParent": { @@ -5873,43 +5873,43 @@ } }, "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", - "ParentFolderId": "integer", + "ParentFolderId": "number", "Number": "string", - "TypeId": "integer", - "OwnerUserId": "integer", + "TypeId": "number", + "OwnerUserId": "number", "TotalSize": "number", - "FilesCounter": "integer", - "FoldersCounter": "integer", + "FilesCounter": "number", + "FoldersCounter": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", - "ModifiedBy": "integer", - "CreatedBy": "integer", - "ProjectId": "integer", - "SearchRingId": "integer", - "SiteId": "integer", - "AssetId": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", + "ProjectId": "number", + "SearchRingId": "number", + "SiteId": "number", + "AssetId": "number", "AllowMultiple": true, "AutoCreate": true, "Description": "string", "IsTemplate": true, - "ProgramId": "integer", - "SourceFolderId": "integer", - "TemplateClassId": "integer", - "TemplateSubType": "integer", + "ProgramId": "number", + "SourceFolderId": "number", + "TemplateClassId": "number", + "TemplateSubType": "number", "IsHidden": true, - "IsDeleted": "integer", - "StatusId": "integer", - "SmsId": "integer", - "ContractId": "integer", - "VendorId": "integer", - "OrganizationUnitId": "integer", - "IncidentId": "integer", - "EventId": "integer", - "ClassInstance": "integer", - "ClassId": "integer", + "IsDeleted": "number", + "StatusId": "number", + "SmsId": "number", + "ContractId": "number", + "VendorId": "number", + "OrganizationUnitId": "number", + "IncidentId": "number", + "EventId": "number", + "ClassInstance": "number", + "ClassId": "number", "LibraryParent": { "@odata.type": "Siterra.Documents.BusinessLogic.Entities.Library.Library" }, @@ -5943,7 +5943,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -5953,13 +5953,13 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ModificationDate": { @@ -5975,7 +5975,7 @@ "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -5990,27 +5990,27 @@ "MasterId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "Number": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "ClassId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ParentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6057,19 +6057,19 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", - "ModifiedBy": "integer", - "CreatedBy": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", "ModificationDate": "string (timestamp)", "CreationDate": "string (timestamp)", - "DomainId": "integer", + "DomainId": "number", "Description": "string", "XmlName": "string", - "MasterId": "integer", - "Number": "integer", - "ClassId": "integer", - "ParentId": "integer", + "MasterId": "number", + "Number": "number", + "ClassId": "number", + "ParentId": "number", "HasChanged": true, "MasterLibraryType": { "@odata.type": "Siterra.Documents.BusinessLogic.Entities.Library.LibraryType" @@ -6096,7 +6096,7 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -6110,13 +6110,13 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreationDate": { @@ -6140,20 +6140,20 @@ "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "SourceClassId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, "ContentTypeId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6164,13 +6164,13 @@ "IsSelfHosted": { "maximum": 32767, "minimum": -32768, - "type": "integer", + "type": "number", "format": "int16" }, "SmsId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6193,21 +6193,21 @@ } }, "example": { - "Id": "integer (identifier)", + "Id": "number (identifier)", "Name": "string", "Path": "string", - "ModifiedBy": "integer", - "CreatedBy": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Sized": "number", "ActualName": "string", - "DomainId": "integer", - "SourceClassId": "integer", - "ContentTypeId": "integer", + "DomainId": "number", + "SourceClassId": "number", + "ContentTypeId": "number", "ClientPath": "string", - "IsSelfHosted": "integer", - "SmsId": "integer", + "IsSelfHosted": "number", + "SmsId": "number", "Latitude": "number", "Longitude": "number", "Documents": [ @@ -6224,13 +6224,13 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Name": { @@ -6244,13 +6244,13 @@ "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreationDate": { @@ -6265,12 +6265,12 @@ } }, "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)" } @@ -6294,12 +6294,12 @@ } ], "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Documents": [ @@ -6329,12 +6329,12 @@ } ], "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Documents": [ @@ -6364,12 +6364,12 @@ } ], "example": { - "Id": "integer (identifier)", - "DomainId": "integer", + "Id": "number (identifier)", + "DomainId": "number", "Name": "string", "Description": "string", - "CreatedBy": "integer", - "ModifiedBy": "integer", + "CreatedBy": "number", + "ModifiedBy": "number", "CreationDate": "string (timestamp)", "ModificationDate": "string (timestamp)", "Documents": [ @@ -6386,19 +6386,19 @@ "Id": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Number": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DocumentId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6415,13 +6415,13 @@ "ModifiedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "CreatedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "Remarks": { @@ -6431,13 +6431,13 @@ "FileId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DocumentOwnerContact": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "DocumentDescription": { @@ -6476,13 +6476,13 @@ "DomainId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "IsDeleted": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "IsReviewed": { @@ -6495,7 +6495,7 @@ "ReviewedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6513,7 +6513,7 @@ "RejectedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6523,7 +6523,7 @@ "ApprovedBy": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32", "nullable": true }, @@ -6559,16 +6559,16 @@ } }, "example": { - "Id": "integer (identifier)", - "Number": "integer", - "DocumentId": "integer", + "Id": "number (identifier)", + "Number": "number", + "DocumentId": "number", "ModificationDate": "string (timestamp)", "CreationDate": "string (timestamp)", - "ModifiedBy": "integer", - "CreatedBy": "integer", + "ModifiedBy": "number", + "CreatedBy": "number", "Remarks": "string", - "FileId": "integer", - "DocumentOwnerContact": "integer", + "FileId": "number", + "DocumentOwnerContact": "number", "DocumentDescription": "string", "DocumentStatusDate": "string (timestamp)", "DocumentFolder": "string", @@ -6577,17 +6577,17 @@ "DocumentType": "string", "DocumentName": "string", "DocumentNumber": "string", - "DomainId": "integer", - "IsDeleted": "integer", + "DomainId": "number", + "IsDeleted": "number", "IsReviewed": true, "ReviewDescription": "string", - "ReviewedBy": "integer", + "ReviewedBy": "number", "IsRejected": true, "RejectedReason": "string", "RejectedDescription": "string", - "RejectedBy": "integer", + "RejectedBy": "number", "IsApproved": true, - "ApprovedBy": "integer", + "ApprovedBy": "number", "ReviewedDate": "string (timestamp)", "RejectedDate": "string (timestamp)", "ApprovedDate": "string (timestamp)", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index cd96032bb..29bdc73d8 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -113,7 +113,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: CategoryDto - name: $select @@ -168,7 +168,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: CategoryDto requestBody: @@ -197,7 +197,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: CategoryDto - name: If-Match @@ -347,7 +347,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: $select @@ -413,7 +413,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -442,7 +442,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -471,7 +471,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto responses: @@ -495,7 +495,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -611,7 +611,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: Id1 @@ -621,7 +621,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: If-Match @@ -650,7 +650,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/search' @@ -675,7 +675,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -747,7 +747,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -771,7 +771,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -805,7 +805,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -868,7 +868,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -901,7 +901,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -938,7 +938,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/search' @@ -1099,7 +1099,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: $select @@ -1168,7 +1168,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto requestBody: @@ -1197,7 +1197,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: If-Match @@ -1226,7 +1226,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - $ref: '#/components/parameters/top' @@ -1321,7 +1321,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: Id1 @@ -1331,7 +1331,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -1359,7 +1359,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: Id1 @@ -1369,7 +1369,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -1432,7 +1432,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: Id1 @@ -1442,7 +1442,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -1475,7 +1475,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: Id1 @@ -1485,7 +1485,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -1522,7 +1522,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: Id1 @@ -1532,7 +1532,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/search' @@ -1557,7 +1557,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - $ref: '#/components/parameters/search' @@ -1582,7 +1582,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - $ref: '#/components/parameters/top' @@ -1640,7 +1640,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto requestBody: @@ -1664,7 +1664,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: LibraryDto - name: If-Match @@ -1841,7 +1841,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: $select @@ -1912,7 +1912,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto requestBody: @@ -1941,7 +1941,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: If-Match @@ -1970,7 +1970,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: $select @@ -2088,7 +2088,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto responses: @@ -2125,7 +2125,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto requestBody: @@ -2149,7 +2149,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: If-Match @@ -2177,7 +2177,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - $ref: '#/components/parameters/top' @@ -2263,7 +2263,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto requestBody: @@ -2296,7 +2296,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: If-Match @@ -2333,7 +2333,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - $ref: '#/components/parameters/search' @@ -2357,7 +2357,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - $ref: '#/components/parameters/top' @@ -2442,7 +2442,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto requestBody: @@ -2475,7 +2475,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: If-Match @@ -2512,7 +2512,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - $ref: '#/components/parameters/search' @@ -2658,7 +2658,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: $select @@ -2724,7 +2724,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -2753,7 +2753,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -2782,7 +2782,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto responses: @@ -2806,7 +2806,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -2922,7 +2922,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: Id1 @@ -2932,7 +2932,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: RevisionDto - name: If-Match @@ -2961,7 +2961,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/search' @@ -2986,7 +2986,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -3058,7 +3058,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -3082,7 +3082,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -3116,7 +3116,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/top' @@ -3179,7 +3179,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto requestBody: @@ -3212,7 +3212,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - name: If-Match @@ -3249,7 +3249,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: DocumentDto - $ref: '#/components/parameters/search' @@ -3283,7 +3283,7 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -3303,7 +3303,7 @@ components: DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ModificationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3313,7 +3313,7 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Tags: @@ -3326,15 +3326,15 @@ components: $ref: '#/components/schemas/Siterra.Documents.App.DTO.RevisionDto' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Description: string Filename: string NumberOfRevisions: string Suffix: string - DomainId: integer + DomainId: number ModificationDate: string (timestamp) - ModifiedBy: integer + ModifiedBy: number Tags: - '@odata.type': Siterra.Documents.App.DTO.DocumentTagRelDto Revisions: @@ -3346,7 +3346,7 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -3360,18 +3360,18 @@ components: LibraryTemplateId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ParentTypeId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ParentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 AllowMultiple: type: boolean @@ -3380,17 +3380,17 @@ components: TypeId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3399,7 +3399,7 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ModificationDate: @@ -3413,20 +3413,20 @@ components: $ref: '#/components/schemas/Siterra.Documents.App.DTO.DocumentDto' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Number: string Description: string - LibraryTemplateId: integer - ParentTypeId: integer - ParentId: integer + LibraryTemplateId: number + ParentTypeId: number + ParentId: number AllowMultiple: true AutoCreate: true - TypeId: integer - DomainId: integer - CreatedBy: integer + TypeId: number + DomainId: number + CreatedBy: number CreationDate: string (timestamp) - ModifiedBy: integer + ModifiedBy: number ModificationDate: string (timestamp) Documents: - '@odata.type': Siterra.Documents.App.DTO.DocumentDto @@ -3437,17 +3437,17 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Number: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DocumentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true DocumentName: @@ -3463,14 +3463,14 @@ components: CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 IsReviewed: type: boolean ReviewedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ReviewedDate: @@ -3483,7 +3483,7 @@ components: ApprovedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ApprovedDate: @@ -3496,7 +3496,7 @@ components: RejectedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true RejectedDate: @@ -3507,7 +3507,7 @@ components: DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Document: anyOf: @@ -3516,23 +3516,23 @@ components: nullable: true x-ms-navigationProperty: true example: - Id: integer (identifier) - Number: integer - DocumentId: integer + Id: number (identifier) + Number: number + DocumentId: number DocumentName: string DocumentDescription: string CreationDate: string (timestamp) - CreatedBy: integer + CreatedBy: number IsReviewed: true - ReviewedBy: integer + ReviewedBy: number ReviewedDate: string (timestamp) IsApproved: true - ApprovedBy: integer + ApprovedBy: number ApprovedDate: string (timestamp) IsRejected: true - RejectedBy: integer + RejectedBy: number RejectedDate: string (timestamp) - DomainId: integer + DomainId: number Document: '@odata.type': Siterra.Documents.BusinessLogic.Entities.Document.Document Siterra.Documents.App.DTO.CategoryDto: @@ -3542,7 +3542,7 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -3561,15 +3561,15 @@ components: DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 example: - Id: integer (identifier) + Id: number (identifier) Name: string Description: string CreationDate: string (timestamp) ModificationDate: string (timestamp) - DomainId: integer + DomainId: number Siterra.Documents.App.DTO.DocumentTagRelDto: title: DocumentTagRelDto type: object @@ -3586,7 +3586,7 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -3597,12 +3597,12 @@ components: StatusId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 TypeId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Keywords: type: string @@ -3614,7 +3614,7 @@ components: CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ModificationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3623,23 +3623,23 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 LibraryId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true OwnerUserId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 StatusDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3648,7 +3648,7 @@ components: LastRevisionId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true CheckoutDate: @@ -3662,7 +3662,7 @@ components: CheckoutUserId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Number: @@ -3682,13 +3682,13 @@ components: LastRevisionFileId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IsDeleted: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 IsNa: type: number @@ -3720,13 +3720,13 @@ components: SourceDocumentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ScraperMapId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true LastDownloadedDate: @@ -3737,13 +3737,13 @@ components: SmsId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IsApprovedOld: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Suffix: @@ -3752,7 +3752,7 @@ components: ScrapeResultId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IsApproved: @@ -3762,19 +3762,19 @@ components: CategoryId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true SectionId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true VersionCount: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 LastFileName: type: string @@ -3816,30 +3816,30 @@ components: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Revision.Revision' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Description: string - StatusId: integer - TypeId: integer + StatusId: number + TypeId: number Keywords: string CreationDate: string (timestamp) - CreatedBy: integer + CreatedBy: number ModificationDate: string (timestamp) - ModifiedBy: integer - DomainId: integer - LibraryId: integer - OwnerUserId: integer + ModifiedBy: number + DomainId: number + LibraryId: number + OwnerUserId: number StatusDate: string (timestamp) - LastRevisionId: integer + LastRevisionId: number CheckoutDate: string (timestamp) CheckoutPath: string - CheckoutUserId: integer + CheckoutUserId: number Number: string OriginalDate: string (timestamp) FileSized: number FileClientPath: string - LastRevisionFileId: integer - IsDeleted: integer + LastRevisionFileId: number + IsDeleted: number IsNa: number IsRejected: number IsReviewed: number @@ -3848,17 +3848,17 @@ components: RejectedDescription: string RejectedReason: string ReviewDescription: string - SourceDocumentId: integer - ScraperMapId: integer + SourceDocumentId: number + ScraperMapId: number LastDownloadedDate: string (timestamp) - SmsId: integer - IsApprovedOld: integer + SmsId: number + IsApprovedOld: number Suffix: string - ScrapeResultId: integer + ScrapeResultId: number IsApproved: number - CategoryId: integer - SectionId: integer - VersionCount: integer + CategoryId: number + SectionId: number + VersionCount: number LastFileName: string DocumentClasses: - '@odata.type': Siterra.Documents.BusinessLogic.Entities.Document.DocumentClass @@ -3881,22 +3881,22 @@ components: ClassInstance: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ClassId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DocumentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3905,7 +3905,7 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ModificationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3920,12 +3920,12 @@ components: nullable: true x-ms-navigationProperty: true example: - ClassInstance: integer - ClassId: integer - DocumentId: integer - CreatedBy: integer + ClassInstance: number + ClassId: number + DocumentId: number + CreatedBy: number CreationDate: string (timestamp) - ModifiedBy: integer + ModifiedBy: number ModificationDate: string (timestamp) IsPrimary: true Document: @@ -3937,27 +3937,27 @@ components: DocumentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 TagId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -3980,11 +3980,11 @@ components: nullable: true x-ms-navigationProperty: true example: - DocumentId: integer - TagId: integer - DomainId: integer - CreatedBy: integer - ModifiedBy: integer + DocumentId: number + TagId: number + DomainId: number + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Document: @@ -3998,12 +3998,12 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -4011,7 +4011,7 @@ components: ParentFolderId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Number: @@ -4020,12 +4020,12 @@ components: TypeId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 OwnerUserId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 TotalSize: type: number @@ -4033,12 +4033,12 @@ components: FilesCounter: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 FoldersCounter: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4051,35 +4051,35 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ProjectId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true SearchRingId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true SiteId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true AssetId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true AllowMultiple: @@ -4094,25 +4094,25 @@ components: ProgramId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true SourceFolderId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true TemplateClassId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true TemplateSubType: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IsHidden: @@ -4120,59 +4120,59 @@ components: IsDeleted: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 StatusId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true SmsId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ContractId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true VendorId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true OrganizationUnitId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IncidentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true EventId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ClassInstance: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ClassId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 LibraryParent: anyOf: @@ -4208,43 +4208,43 @@ components: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.Library' x-ms-navigationProperty: true example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string - ParentFolderId: integer + ParentFolderId: number Number: string - TypeId: integer - OwnerUserId: integer + TypeId: number + OwnerUserId: number TotalSize: number - FilesCounter: integer - FoldersCounter: integer + FilesCounter: number + FoldersCounter: number CreationDate: string (timestamp) ModificationDate: string (timestamp) - ModifiedBy: integer - CreatedBy: integer - ProjectId: integer - SearchRingId: integer - SiteId: integer - AssetId: integer + ModifiedBy: number + CreatedBy: number + ProjectId: number + SearchRingId: number + SiteId: number + AssetId: number AllowMultiple: true AutoCreate: true Description: string IsTemplate: true - ProgramId: integer - SourceFolderId: integer - TemplateClassId: integer - TemplateSubType: integer + ProgramId: number + SourceFolderId: number + TemplateClassId: number + TemplateSubType: number IsHidden: true - IsDeleted: integer - StatusId: integer - SmsId: integer - ContractId: integer - VendorId: integer - OrganizationUnitId: integer - IncidentId: integer - EventId: integer - ClassInstance: integer - ClassId: integer + IsDeleted: number + StatusId: number + SmsId: number + ContractId: number + VendorId: number + OrganizationUnitId: number + IncidentId: number + EventId: number + ClassInstance: number + ClassId: number LibraryParent: '@odata.type': Siterra.Documents.BusinessLogic.Entities.Library.Library Type: @@ -4264,7 +4264,7 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -4272,12 +4272,12 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ModificationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4290,7 +4290,7 @@ components: DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Description: @@ -4302,24 +4302,24 @@ components: MasterId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Number: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ClassId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ParentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true HasChanged: @@ -4347,19 +4347,19 @@ components: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Library.LibraryType' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string - ModifiedBy: integer - CreatedBy: integer + ModifiedBy: number + CreatedBy: number ModificationDate: string (timestamp) CreationDate: string (timestamp) - DomainId: integer + DomainId: number Description: string XmlName: string - MasterId: integer - Number: integer - ClassId: integer - ParentId: integer + MasterId: number + Number: number + ClassId: number + ParentId: number HasChanged: true MasterLibraryType: '@odata.type': Siterra.Documents.BusinessLogic.Entities.Library.LibraryType @@ -4376,7 +4376,7 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -4387,12 +4387,12 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4411,18 +4411,18 @@ components: DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 SourceClassId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ContentTypeId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ClientPath: @@ -4431,12 +4431,12 @@ components: IsSelfHosted: maximum: 32767 minimum: -32768 - type: integer + type: number format: int16 SmsId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true Latitude: @@ -4453,21 +4453,21 @@ components: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document' x-ms-navigationProperty: true example: - Id: integer (identifier) + Id: number (identifier) Name: string Path: string - ModifiedBy: integer - CreatedBy: integer + ModifiedBy: number + CreatedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Sized: number ActualName: string - DomainId: integer - SourceClassId: integer - ContentTypeId: integer + DomainId: number + SourceClassId: number + ContentTypeId: number ClientPath: string - IsSelfHosted: integer - SmsId: integer + IsSelfHosted: number + SmsId: number Latitude: number Longitude: number Documents: @@ -4479,12 +4479,12 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Name: type: string @@ -4495,12 +4495,12 @@ components: CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreationDate: pattern: '^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$' @@ -4511,12 +4511,12 @@ components: type: string format: date-time example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Siterra.Documents.BusinessLogic.Entities.Tags.UserDefinedTag: @@ -4530,12 +4530,12 @@ components: items: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.DocumentTagRel' example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Documents: @@ -4552,12 +4552,12 @@ components: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document' x-ms-navigationProperty: true example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Documents: @@ -4574,12 +4574,12 @@ components: $ref: '#/components/schemas/Siterra.Documents.BusinessLogic.Entities.Document.Document' x-ms-navigationProperty: true example: - Id: integer (identifier) - DomainId: integer + Id: number (identifier) + DomainId: number Name: string Description: string - CreatedBy: integer - ModifiedBy: integer + CreatedBy: number + ModifiedBy: number CreationDate: string (timestamp) ModificationDate: string (timestamp) Documents: @@ -4591,17 +4591,17 @@ components: Id: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Number: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DocumentId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ModificationDate: @@ -4615,12 +4615,12 @@ components: ModifiedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 CreatedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 Remarks: type: string @@ -4628,12 +4628,12 @@ components: FileId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DocumentOwnerContact: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 DocumentDescription: type: string @@ -4663,12 +4663,12 @@ components: DomainId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 IsDeleted: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 IsReviewed: type: boolean @@ -4678,7 +4678,7 @@ components: ReviewedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IsRejected: @@ -4692,7 +4692,7 @@ components: RejectedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true IsApproved: @@ -4700,7 +4700,7 @@ components: ApprovedBy: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 nullable: true ReviewedDate: @@ -4725,16 +4725,16 @@ components: nullable: true x-ms-navigationProperty: true example: - Id: integer (identifier) - Number: integer - DocumentId: integer + Id: number (identifier) + Number: number + DocumentId: number ModificationDate: string (timestamp) CreationDate: string (timestamp) - ModifiedBy: integer - CreatedBy: integer + ModifiedBy: number + CreatedBy: number Remarks: string - FileId: integer - DocumentOwnerContact: integer + FileId: number + DocumentOwnerContact: number DocumentDescription: string DocumentStatusDate: string (timestamp) DocumentFolder: string @@ -4743,17 +4743,17 @@ components: DocumentType: string DocumentName: string DocumentNumber: string - DomainId: integer - IsDeleted: integer + DomainId: number + IsDeleted: number IsReviewed: true ReviewDescription: string - ReviewedBy: integer + ReviewedBy: number IsRejected: true RejectedReason: string RejectedDescription: string - RejectedBy: integer + RejectedBy: number IsApproved: true - ApprovedBy: integer + ApprovedBy: number ReviewedDate: string (timestamp) RejectedDate: string (timestamp) ApprovedDate: string (timestamp) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index f26cdbedf..9b9b4830e 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -7061,7 +7061,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7126,7 +7126,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7176,7 +7176,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7228,7 +7228,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7325,7 +7325,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7410,7 +7410,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7421,7 +7421,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7466,7 +7466,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7510,7 +7510,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7570,7 +7570,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -7609,7 +7609,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11133,7 +11133,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11198,7 +11198,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11248,7 +11248,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11300,7 +11300,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11397,7 +11397,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11482,7 +11482,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11493,7 +11493,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11538,7 +11538,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11582,7 +11582,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11642,7 +11642,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -11681,7 +11681,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12091,7 +12091,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12156,7 +12156,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12206,7 +12206,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12258,7 +12258,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12355,7 +12355,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12440,7 +12440,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12451,7 +12451,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12496,7 +12496,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12540,7 +12540,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12600,7 +12600,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -12639,7 +12639,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16130,7 +16130,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16196,7 +16196,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16247,7 +16247,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16296,7 +16296,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16390,7 +16390,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16472,7 +16472,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16483,7 +16483,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16529,7 +16529,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16574,7 +16574,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16635,7 +16635,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -16675,7 +16675,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -23777,7 +23777,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -23850,7 +23850,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -23908,7 +23908,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -23968,7 +23968,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24073,7 +24073,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24166,7 +24166,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24177,7 +24177,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24230,7 +24230,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24282,7 +24282,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24350,7 +24350,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -24397,7 +24397,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28547,7 +28547,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28620,7 +28620,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28678,7 +28678,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28738,7 +28738,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28843,7 +28843,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28936,7 +28936,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -28947,7 +28947,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29000,7 +29000,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29052,7 +29052,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29120,7 +29120,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29167,7 +29167,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29666,7 +29666,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29739,7 +29739,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29797,7 +29797,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29857,7 +29857,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -29962,7 +29962,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30055,7 +30055,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30066,7 +30066,7 @@ "name": "PlanItemId", "description": "The unique identifier of PlanItem", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30119,7 +30119,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30171,7 +30171,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30239,7 +30239,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30286,7 +30286,7 @@ "name": "TripId", "description": "The unique identifier of Trip", "required": true, - "type": "integer", + "type": "number", "format": "int32", "maximum": 2147483647, "minimum": -2147483648, @@ -30721,7 +30721,7 @@ "allOf": [ { "format": "int64", - "type": "integer" + "type": "number" } ] }, @@ -30874,7 +30874,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ShareId": { "format": "uuid", @@ -30934,7 +30934,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" }, "ConfirmationCode": { "type": "string" @@ -31030,7 +31030,7 @@ "allOf": [ { "format": "int64", - "type": "integer" + "type": "number" } ] }, @@ -31059,7 +31059,7 @@ "allOf": [ { "format": "int64", - "type": "integer" + "type": "number" } ] }, @@ -31631,7 +31631,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" } } } @@ -31651,7 +31651,7 @@ "format": "int32", "maximum": 2147483647, "minimum": -2147483648, - "type": "integer" + "type": "number" } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index b960188e6..645e61d5d 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -4737,7 +4737,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -4784,7 +4784,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -4821,7 +4821,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -4859,7 +4859,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -4922,7 +4922,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -4977,7 +4977,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -4986,7 +4986,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -5019,7 +5019,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -5049,7 +5049,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -5087,7 +5087,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -5115,7 +5115,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7490,7 +7490,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7537,7 +7537,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7574,7 +7574,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7612,7 +7612,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7675,7 +7675,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7730,7 +7730,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7739,7 +7739,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7772,7 +7772,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7802,7 +7802,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7840,7 +7840,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -7868,7 +7868,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8150,7 +8150,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8197,7 +8197,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8234,7 +8234,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8272,7 +8272,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8335,7 +8335,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8390,7 +8390,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8399,7 +8399,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8432,7 +8432,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8462,7 +8462,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8500,7 +8500,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -8528,7 +8528,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -10856,7 +10856,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -10903,7 +10903,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -10940,7 +10940,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -10975,7 +10975,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11035,7 +11035,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11087,7 +11087,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11096,7 +11096,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11129,7 +11129,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11159,7 +11159,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11197,7 +11197,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -11225,7 +11225,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16079,7 +16079,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16132,7 +16132,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16175,7 +16175,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16219,7 +16219,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16288,7 +16288,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16349,7 +16349,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16358,7 +16358,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16397,7 +16397,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16433,7 +16433,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16477,7 +16477,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -16511,7 +16511,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19351,7 +19351,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19404,7 +19404,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19447,7 +19447,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19491,7 +19491,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19560,7 +19560,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19621,7 +19621,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19630,7 +19630,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19669,7 +19669,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19705,7 +19705,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19749,7 +19749,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -19783,7 +19783,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20132,7 +20132,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20185,7 +20185,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20228,7 +20228,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20272,7 +20272,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20341,7 +20341,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20402,7 +20402,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20411,7 +20411,7 @@ paths: name: PlanItemId description: The unique identifier of PlanItem required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20450,7 +20450,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20486,7 +20486,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20530,7 +20530,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20564,7 +20564,7 @@ paths: name: TripId description: The unique identifier of Trip required: true - type: integer + type: number format: int32 maximum: 2147483647 minimum: -2147483648 @@ -20846,7 +20846,7 @@ definitions: format: int64 allOf: - format: int64 - type: integer + type: number Emails: type: array items: @@ -20944,7 +20944,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ShareId: format: uuid pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' @@ -20987,7 +20987,7 @@ definitions: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number ConfirmationCode: type: string StartsAt: @@ -21044,7 +21044,7 @@ definitions: format: int64 allOf: - format: int64 - type: integer + type: number Peers: type: array items: @@ -21060,7 +21060,7 @@ definitions: format: int64 allOf: - format: int64 - type: integer + type: number BossOffice: $ref: '#/definitions/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' DirectReports: @@ -21450,7 +21450,7 @@ parameters: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number GetPeersForTripRequestBody: in: body name: body @@ -21465,7 +21465,7 @@ parameters: format: int32 maximum: 2147483647 minimum: -2147483648 - type: integer + type: number responses: error: description: error diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 2210b1217..165f44bd3 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -7805,7 +7805,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -7883,7 +7883,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -7937,7 +7937,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -7990,7 +7990,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -8108,7 +8108,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -8210,7 +8210,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -8223,7 +8223,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -8272,7 +8272,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -8318,7 +8318,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -8385,7 +8385,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -8426,7 +8426,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12277,7 +12277,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12355,7 +12355,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12409,7 +12409,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12462,7 +12462,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12580,7 +12580,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12682,7 +12682,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12695,7 +12695,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -12744,7 +12744,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12790,7 +12790,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12857,7 +12857,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -12898,7 +12898,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13328,7 +13328,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13406,7 +13406,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13460,7 +13460,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13513,7 +13513,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13631,7 +13631,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13733,7 +13733,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13746,7 +13746,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -13795,7 +13795,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13841,7 +13841,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13908,7 +13908,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -13949,7 +13949,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -17907,7 +17907,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -17988,7 +17988,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18045,7 +18045,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18097,7 +18097,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18214,7 +18214,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18315,7 +18315,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18328,7 +18328,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -18380,7 +18380,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18429,7 +18429,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18499,7 +18499,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -18543,7 +18543,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26505,7 +26505,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26593,7 +26593,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26657,7 +26657,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26720,7 +26720,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26848,7 +26848,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26960,7 +26960,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -26973,7 +26973,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -27032,7 +27032,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -27088,7 +27088,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -27165,7 +27165,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -27216,7 +27216,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -31869,7 +31869,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -31957,7 +31957,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32021,7 +32021,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32084,7 +32084,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32212,7 +32212,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32324,7 +32324,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32337,7 +32337,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -32396,7 +32396,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32452,7 +32452,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32529,7 +32529,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -32580,7 +32580,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33123,7 +33123,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33211,7 +33211,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33275,7 +33275,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33338,7 +33338,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33466,7 +33466,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33578,7 +33578,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33591,7 +33591,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "PlanItem" @@ -33650,7 +33650,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33706,7 +33706,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33783,7 +33783,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -33834,7 +33834,7 @@ "schema": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "x-ms-docs-key-type": "Trip" @@ -34316,14 +34316,15 @@ "Age": { "oneOf": [ { - "type": "integer", - "format": "int64" + "type": "number", + "format": "int64", + "nullable": true }, { - "type": "string" + "type": "string", + "nullable": true } - ], - "nullable": true + ] }, "Emails": { "type": "array", @@ -34527,7 +34528,7 @@ "TripId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ShareId": { @@ -34543,10 +34544,12 @@ "oneOf": [ { "type": "number", - "format": "float" + "format": "float", + "nullable": true }, { - "type": "string" + "type": "string", + "nullable": true }, { "$ref": "#/components/schemas/ReferenceNumeric" @@ -34595,7 +34598,7 @@ "PlanItemId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" }, "ConfirmationCode": { @@ -34729,11 +34732,13 @@ "Cost": { "oneOf": [ { - "type": "integer", - "format": "int64" + "type": "number", + "format": "int64", + "nullable": true }, { - "type": "string" + "type": "string", + "nullable": true } ] }, @@ -34760,11 +34765,13 @@ "Budget": { "oneOf": [ { - "type": "integer", - "format": "int64" + "type": "number", + "format": "int64", + "nullable": true }, { - "type": "string" + "type": "string", + "nullable": true } ] }, @@ -35786,7 +35793,7 @@ "tripId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" } } @@ -35808,7 +35815,7 @@ "tripId": { "maximum": 2147483647, "minimum": -2147483648, - "type": "integer", + "type": "number", "format": "int32" } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index ccd8ef1f8..a64e5ea71 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -5213,7 +5213,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -5269,7 +5269,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -5308,7 +5308,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -5346,7 +5346,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -5424,7 +5424,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -5492,7 +5492,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -5502,7 +5502,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -5537,7 +5537,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -5568,7 +5568,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -5611,7 +5611,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -5641,7 +5641,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -8230,7 +8230,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -8286,7 +8286,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -8325,7 +8325,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -8363,7 +8363,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -8441,7 +8441,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -8509,7 +8509,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -8519,7 +8519,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -8554,7 +8554,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -8585,7 +8585,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -8628,7 +8628,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -8658,7 +8658,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -8953,7 +8953,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -9009,7 +9009,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -9048,7 +9048,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -9086,7 +9086,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -9164,7 +9164,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -9232,7 +9232,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -9242,7 +9242,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -9277,7 +9277,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -9308,7 +9308,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -9351,7 +9351,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -9381,7 +9381,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -11995,7 +11995,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -12052,7 +12052,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -12092,7 +12092,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -12128,7 +12128,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -12204,7 +12204,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -12270,7 +12270,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -12280,7 +12280,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -12316,7 +12316,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -12348,7 +12348,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -12392,7 +12392,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -12423,7 +12423,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -17799,7 +17799,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -17862,7 +17862,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -17908,7 +17908,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -17953,7 +17953,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -18038,7 +18038,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -18113,7 +18113,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -18123,7 +18123,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -18165,7 +18165,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -18203,7 +18203,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -18253,7 +18253,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -18290,7 +18290,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -21432,7 +21432,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -21495,7 +21495,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -21541,7 +21541,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -21586,7 +21586,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -21671,7 +21671,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -21746,7 +21746,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -21756,7 +21756,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -21798,7 +21798,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -21836,7 +21836,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -21886,7 +21886,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -21923,7 +21923,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -22297,7 +22297,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: $select @@ -22360,7 +22360,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -22406,7 +22406,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -22451,7 +22451,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -22536,7 +22536,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -22611,7 +22611,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: PlanItemId @@ -22621,7 +22621,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: PlanItem - name: If-Match @@ -22663,7 +22663,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/search' @@ -22701,7 +22701,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - $ref: '#/components/parameters/top' @@ -22751,7 +22751,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip requestBody: @@ -22788,7 +22788,7 @@ paths: schema: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 x-ms-docs-key-type: Trip - name: If-Match @@ -23101,10 +23101,11 @@ components: $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.PersonGender' Age: oneOf: - - type: integer + - type: number format: int64 + nullable: true - type: string - nullable: true + nullable: true Emails: type: array items: @@ -23230,7 +23231,7 @@ components: TripId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ShareId: pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$' @@ -23243,7 +23244,9 @@ components: oneOf: - type: number format: float + nullable: true - type: string + nullable: true - $ref: '#/components/schemas/ReferenceNumeric' Description: type: string @@ -23277,7 +23280,7 @@ components: PlanItemId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 ConfirmationCode: type: string @@ -23352,9 +23355,11 @@ components: properties: Cost: oneOf: - - type: integer + - type: number format: int64 + nullable: true - type: string + nullable: true Peers: type: array items: @@ -23368,9 +23373,11 @@ components: properties: Budget: oneOf: - - type: integer + - type: number format: int64 + nullable: true - type: string + nullable: true BossOffice: anyOf: - $ref: '#/components/schemas/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Location' @@ -24030,7 +24037,7 @@ components: tripId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 required: true GetPeersForTripRequestBody: @@ -24045,7 +24052,7 @@ components: tripId: maximum: 2147483647 minimum: -2147483648 - type: integer + type: number format: int32 required: true tags: From 78af6ff3c49a6d65529d410669241e12d294202a Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Oct 2024 07:20:32 -0400 Subject: [PATCH 21/52] chore: refactoring Signed-off-by: Vincent Biret --- .../Generator/OpenApiEdmTypeSchemaGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs index 5d7087fc4..1144abf3e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiEdmTypeSchemaGenerator.cs @@ -133,8 +133,8 @@ public static OpenApiSchema CreateSchema(this ODataContext context, IEdmPrimitiv } // Nullable properties are marked with the keyword nullable and a value of true. - // oneOf and anyOf don't have type, so they can't be set to nullable, entries are nullable - schema.Nullable = schema.AnyOf == null && schema.OneOf == null && primitiveType.IsNullable; + // nullable cannot be true when type is empty, often common in anyof/allOf since individual entries are nullable + schema.Nullable = !string.IsNullOrEmpty(schema.Type) && primitiveType.IsNullable; } return schema; From c89dc732d2fab081eec9dea62c22499cc78f70e3 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:06:28 +0300 Subject: [PATCH 22/52] Updates PUT operation id prefix from Update to Set (#601) --- .../ComplexPropertyUpdateOperationHandler.cs | 53 ++++++++++--------- .../Operation/EntityUpdateOperationHandler.cs | 3 +- ...avigationPropertyUpdateOperationHandler.cs | 2 +- ...ComplexPropertyPutOperationHandlerTests.cs | 4 +- .../EntityPutOperationHandlerTests.cs | 2 +- ...igationPropertyPutOperationHandlerTests.cs | 2 +- .../Resources/TripService.OpenApi.V2.json | 4 +- .../Resources/TripService.OpenApi.V2.yaml | 4 +- .../Resources/TripService.OpenApi.json | 4 +- .../Resources/TripService.OpenApi.yaml | 4 +- 10 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs index d3790baa6..0d3e61e9c 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs @@ -23,9 +23,9 @@ protected override void Initialize(ODataContext context, ODataPath path) { base.Initialize(context, path); - _updateRestrictions = Context.Model.GetRecord(TargetPath, CapabilitiesConstants.UpdateRestrictions); - var complexPropertyUpdateRestrictions = Context.Model.GetRecord(ComplexPropertySegment.Property, CapabilitiesConstants.UpdateRestrictions); - _updateRestrictions?.MergePropertiesIfNull(complexPropertyUpdateRestrictions); + _updateRestrictions = Context.Model.GetRecord(TargetPath, CapabilitiesConstants.UpdateRestrictions); + var complexPropertyUpdateRestrictions = Context.Model.GetRecord(ComplexPropertySegment.Property, CapabilitiesConstants.UpdateRestrictions); + _updateRestrictions?.MergePropertiesIfNull(complexPropertyUpdateRestrictions); _updateRestrictions ??= complexPropertyUpdateRestrictions; } @@ -40,7 +40,8 @@ protected override void SetBasicInfo(OpenApiOperation operation) // OperationId if (Context.Settings.EnableOperationId) { - operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, "Update"); + string prefix = OperationType == OperationType.Patch ? "Update" : "Set"; + operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, prefix); } } @@ -101,37 +102,37 @@ protected override void AppendCustomParameters(OpenApiOperation operation) private OpenApiSchema GetOpenApiSchema() { - var schema = new OpenApiSchema - { - UnresolvedReference = true, - Reference = new OpenApiReference - { - Type = ReferenceType.Schema, - Id = ComplexPropertySegment.ComplexType.FullName() - } - }; - - if (ComplexPropertySegment.Property.Type.IsCollection()) - { + var schema = new OpenApiSchema + { + UnresolvedReference = true, + Reference = new OpenApiReference + { + Type = ReferenceType.Schema, + Id = ComplexPropertySegment.ComplexType.FullName() + } + }; + + if (ComplexPropertySegment.Property.Type.IsCollection()) + { return new OpenApiSchema { Type = Constants.ObjectType, - Properties = new Dictionary - { - { + Properties = new Dictionary + { + { "value", new OpenApiSchema { Type = "array", Items = schema - } - } + } + } } - }; - } - else - { - return schema; + }; + } + else + { + return schema; } } } \ No newline at end of file diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs index 7ce526df2..6317c7462 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EntityUpdateOperationHandler.cs @@ -50,7 +50,8 @@ protected override void SetBasicInfo(OpenApiOperation operation) if (Context.Settings.EnableOperationId) { string typeName = entityType.Name; - string operationName = $"Update{ Utils.UpperFirstChar(typeName)}"; + string prefix = OperationType == OperationType.Patch ? "Update" : "Set"; + string operationName = $"{prefix}{ Utils.UpperFirstChar(typeName)}"; if (keySegment.IsAlternateKey) { string alternateKeyName = string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x))); diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs index 0ae4b5009..35a47c932 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyUpdateOperationHandler.cs @@ -41,7 +41,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) // OperationId if (Context.Settings.EnableOperationId) { - string prefix = "Update"; + string prefix = OperationType == OperationType.Patch ? "Update" : "Set"; operation.OperationId = GetOperationId(prefix); } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs index 007b362fe..85ddcde6f 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/ComplexPropertyPutOperationHandlerTests.cs @@ -61,7 +61,7 @@ public void CreateComplexPropertyPutOperationReturnsCorrectOperationForSingle(bo if (enableOperationId) { - Assert.Equal("Customers.UpdateBillingAddress", put.OperationId); + Assert.Equal("Customers.SetBillingAddress", put.OperationId); } else { @@ -108,7 +108,7 @@ public void CreateComplexPropertyPutOperationReturnsCorrectOperationForCollectio if (enableOperationId) { - Assert.Equal("Customers.UpdateAlternativeAddresses", put.OperationId); + Assert.Equal("Customers.SetAlternativeAddresses", put.OperationId); } else { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntityPutOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntityPutOperationHandlerTests.cs index fb5f11c24..bee829611 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntityPutOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EntityPutOperationHandlerTests.cs @@ -66,7 +66,7 @@ public void CreateEntityPutOperationReturnsCorrectOperation(bool enableOperation if (enableOperationId) { - Assert.Equal("Customers.Customer.UpdateCustomer", putOperation.OperationId); + Assert.Equal("Customers.Customer.SetCustomer", putOperation.OperationId); } else { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyPutOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyPutOperationHandlerTests.cs index 499863bc0..9c0a25bfe 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyPutOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyPutOperationHandlerTests.cs @@ -71,7 +71,7 @@ public void CreateNavigationPutOperationReturnsCorrectOperation(bool enableOpera if (enableOperationId) { - Assert.Equal("People.UpdateBestFriend", operation.OperationId); + Assert.Equal("People.SetBestFriend", operation.OperationId); } else { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 3e3f587b8..5f9d201d0 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -165,7 +165,7 @@ "Airlines.Airline" ], "summary": "Update entity in Airlines", - "operationId": "Airlines.Airline.UpdateAirline", + "operationId": "Airlines.Airline.SetAirline", "consumes": [ "application/json" ], @@ -534,7 +534,7 @@ "Airports.AirportLocation" ], "summary": "Update property Location value.", - "operationId": "Airports.UpdateLocation", + "operationId": "Airports.SetLocation", "consumes": [ "application/json" ], diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index 89ee65362..92cc03a20 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -107,7 +107,7 @@ paths: tags: - Airlines.Airline summary: Update entity in Airlines - operationId: Airlines.Airline.UpdateAirline + operationId: Airlines.Airline.SetAirline consumes: - application/json parameters: @@ -349,7 +349,7 @@ paths: tags: - Airports.AirportLocation summary: Update property Location value. - operationId: Airports.UpdateLocation + operationId: Airports.SetLocation consumes: - application/json parameters: diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index d89fdd911..82c5c99a7 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -192,7 +192,7 @@ "Airlines.Airline" ], "summary": "Update entity in Airlines", - "operationId": "Airlines.Airline.UpdateAirline", + "operationId": "Airlines.Airline.SetAirline", "parameters": [ { "name": "AirlineCode", @@ -609,7 +609,7 @@ "Airports.AirportLocation" ], "summary": "Update property Location value.", - "operationId": "Airports.UpdateLocation", + "operationId": "Airports.SetLocation", "parameters": [ { "name": "IcaoCode", diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index 25510e863..c08786ea7 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -125,7 +125,7 @@ paths: tags: - Airlines.Airline summary: Update entity in Airlines - operationId: Airlines.Airline.UpdateAirline + operationId: Airlines.Airline.SetAirline parameters: - name: AirlineCode in: path @@ -398,7 +398,7 @@ paths: tags: - Airports.AirportLocation summary: Update property Location value. - operationId: Airports.UpdateLocation + operationId: Airports.SetLocation parameters: - name: IcaoCode in: path From 4136c6a1ac893ef78b1c3c847b9c6ed6322859ea Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:35:40 +0300 Subject: [PATCH 23/52] Creates unique operation ids for paths with composable overloaded functions (#590) * Update unit function operation test * Account for overloaded functions in any segment * Update release note Signed-off-by: Vincent Biret --- .../Operation/EdmOperationOperationHandler.cs | 75 ++++++++++--------- .../EdmFunctionOperationHandlerTests.cs | 61 ++++++++++++++- 2 files changed, 99 insertions(+), 37 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 72ebb2258..3e4cb2743 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -45,7 +45,7 @@ internal abstract class EdmOperationOperationHandler : OperationHandler /// protected override void Initialize(ODataContext context, ODataPath path) - { + { base.Initialize(context, path); // It's bound operation, the first segment must be the navigaiton source. @@ -57,9 +57,9 @@ protected override void Initialize(ODataContext context, ODataPath path) HasTypeCast = path.Segments.Any(s => s is ODataTypeCastSegment); - _operationRestriction = Context.Model.GetRecord(TargetPath, CapabilitiesConstants.OperationRestrictions); - var operationRestrictions = Context.Model.GetRecord(EdmOperation, CapabilitiesConstants.OperationRestrictions); - _operationRestriction?.MergePropertiesIfNull(operationRestrictions); + _operationRestriction = Context.Model.GetRecord(TargetPath, CapabilitiesConstants.OperationRestrictions); + var operationRestrictions = Context.Model.GetRecord(EdmOperation, CapabilitiesConstants.OperationRestrictions); + _operationRestriction?.MergePropertiesIfNull(operationRestrictions); _operationRestriction ??= operationRestrictions; } @@ -81,6 +81,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) // duplicates in entity vs entityset functions/actions List identifiers = new(); + string pathHash = string.Empty; foreach (ODataSegment segment in Path.Segments) { if (segment is ODataKeySegment keySegment) @@ -89,41 +90,43 @@ protected override void SetBasicInfo(OpenApiOperation operation) { identifiers.Add(segment.EntityType.Name); continue; - } - - // We'll consider alternate keys in the operation id to eliminate potential duplicates with operation id of primary path - if (segment == Path.Segments.Last()) - { - identifiers.Add("By" + string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x)))); - } - else - { - identifiers.Add(keySegment.Identifier); - } + } + + // We'll consider alternate keys in the operation id to eliminate potential duplicates with operation id of primary path + if (segment == Path.Segments.Last()) + { + identifiers.Add("By" + string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x)))); + } + else + { + identifiers.Add(keySegment.Identifier); + } + } + else if (segment is ODataOperationSegment opSegment) + { + if (opSegment.Operation is IEdmFunction function && Context.Model.IsOperationOverload(function)) + { + // Hash the segment to avoid duplicate operationIds + pathHash = segment.GetPathHash(Context.Settings); + } + + identifiers.Add(segment.Identifier); } else { - identifiers.Add(segment.Identifier); + identifiers.Add(segment.Identifier); } } string operationId = string.Join(".", identifiers); - if (EdmOperation.IsAction()) + if (!string.IsNullOrEmpty(pathHash)) { - operation.OperationId = operationId; + operation.OperationId = operationId + "-" + pathHash; } else { - if (Path.LastSegment is ODataOperationSegment operationSegment && - Context.Model.IsOperationOverload(operationSegment.Operation)) - { - operation.OperationId = operationId + "-" + Path.LastSegment.GetPathHash(Context.Settings); - } - else - { - operation.OperationId = operationId; - } + operation.OperationId = operationId; } } @@ -269,15 +272,15 @@ protected override void SetExternalDocs(OpenApiOperation operation) if (Context.Settings.ShowExternalDocs) { var externalDocs = Context.Model.GetLinkRecord(TargetPath, CustomLinkRel) ?? - Context.Model.GetLinkRecord(EdmOperation, CustomLinkRel); - - if (externalDocs != null) - { - operation.ExternalDocs = new OpenApiExternalDocs() - { - Description = CoreConstants.ExternalDocsDescription, - Url = externalDocs.Href - }; + Context.Model.GetLinkRecord(EdmOperation, CustomLinkRel); + + if (externalDocs != null) + { + operation.ExternalDocs = new OpenApiExternalDocs() + { + Description = CoreConstants.ExternalDocsDescription, + Url = externalDocs.Href + }; } } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index de817a521..7ad2cbf94 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -1,4 +1,4 @@ -// ------------------------------------------------------------ +// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------ @@ -299,6 +299,65 @@ public void CreateOperationForOverloadEdmFunctionReturnsCorrectOperationId(bool } } + [Theory] + [InlineData(true)] + [InlineData(false)] + public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperationId(bool enableOperationId) + { + // Arrange + EdmModel model = new(); + EdmEntityType customer = new("NS", "Customer"); + customer.AddKeys(customer.AddStructuralProperty("ID", EdmPrimitiveTypeKind.Int32)); + model.AddElement(customer); + + EdmFunction function = new("NS", "MyFunction", EdmCoreModel.Instance.GetString(false), true, null, false); + function.AddParameter("entity", new EdmEntityTypeReference(customer, false)); + function.AddParameter("param", EdmCoreModel.Instance.GetString(false)); + model.AddElement(function); + + function = new EdmFunction("NS", "MyFunction", EdmCoreModel.Instance.GetString(false), true, null, false); + function.AddParameter("entity", new EdmEntityTypeReference(customer, false)); + function.AddParameter("param", EdmCoreModel.Instance.GetString(false)); + function.AddParameter("param2", EdmCoreModel.Instance.GetString(false)); + model.AddElement(function); + + EdmFunction function2 = new("NS", "MyFunction2", EdmCoreModel.Instance.GetString(false), true, null, false); + function2.AddParameter("entity2", new EdmEntityTypeReference(customer, false)); + function2.AddParameter("param3", EdmCoreModel.Instance.GetString(false)); + model.AddElement(function2); + + EdmEntityContainer container = new("NS", "Default"); + EdmEntitySet customers = new(container, "Customers", customer); + model.AddElement(container); + + OpenApiConvertSettings settings = new OpenApiConvertSettings + { + EnableOperationId = enableOperationId, + AddSingleQuotesForStringParameters = true, + }; + ODataContext context = new(model, settings); + + ODataPath path = new(new ODataNavigationSourceSegment(customers), + new ODataKeySegment(customer), + new ODataOperationSegment(function), + new ODataOperationSegment(function2)); + + // Act + var operation = _operationHandler.CreateOperation(context, path); + + // Assert + Assert.NotNull(operation); + + if (enableOperationId) + { + Assert.Equal("Customers.Customer.MyFunction.MyFunction2-df74", operation.OperationId); + } + else + { + Assert.Null(operation.OperationId); + } + } + [Theory] [InlineData(true)] [InlineData(false)] From c53d3a580bf90d55d85b5c5d61bf56dea6ca2809 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:17:18 +0300 Subject: [PATCH 24/52] Ensures unique generation of operation ids for paths with composable overloaded functions where all functions in path are overloaded (#595) * Ensure unique operation ids for composable functions with both overloaded * Update test to validate fix * Update release notes Signed-off-by: Vincent Biret --- .../Operation/EdmOperationOperationHandler.cs | 4 +- .../EdmFunctionOperationHandlerTests.cs | 72 ++++++++++++++----- 2 files changed, 56 insertions(+), 20 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 3e4cb2743..d944fcf7b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -107,7 +107,9 @@ protected override void SetBasicInfo(OpenApiOperation operation) if (opSegment.Operation is IEdmFunction function && Context.Model.IsOperationOverload(function)) { // Hash the segment to avoid duplicate operationIds - pathHash = segment.GetPathHash(Context.Settings); + pathHash = string.IsNullOrEmpty(pathHash) + ? opSegment.GetPathHash(Context.Settings) + : (pathHash + opSegment.GetPathHash(Context.Settings)).GetHashSHA256()[..4]; } identifiers.Add(segment.Identifier); diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index 7ad2cbf94..e899b8e43 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -310,22 +310,29 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati customer.AddKeys(customer.AddStructuralProperty("ID", EdmPrimitiveTypeKind.Int32)); model.AddElement(customer); - EdmFunction function = new("NS", "MyFunction", EdmCoreModel.Instance.GetString(false), true, null, false); - function.AddParameter("entity", new EdmEntityTypeReference(customer, false)); - function.AddParameter("param", EdmCoreModel.Instance.GetString(false)); - model.AddElement(function); + // Overloaded function 1 + EdmFunction function1 = new("NS", "MyFunction1", EdmCoreModel.Instance.GetString(false), true, null, false); + function1.AddParameter("entity", new EdmEntityTypeReference(customer, false)); + model.AddElement(function1); - function = new EdmFunction("NS", "MyFunction", EdmCoreModel.Instance.GetString(false), true, null, false); - function.AddParameter("entity", new EdmEntityTypeReference(customer, false)); - function.AddParameter("param", EdmCoreModel.Instance.GetString(false)); - function.AddParameter("param2", EdmCoreModel.Instance.GetString(false)); - model.AddElement(function); + // Overloaded function 1 + EdmFunction function2 = new("NS", "MyFunction1", EdmCoreModel.Instance.GetString(false), true, null, false); + function2.AddParameter("entity", new EdmEntityTypeReference(customer, false)); + function2.AddParameter("param", EdmCoreModel.Instance.GetString(false)); - EdmFunction function2 = new("NS", "MyFunction2", EdmCoreModel.Instance.GetString(false), true, null, false); - function2.AddParameter("entity2", new EdmEntityTypeReference(customer, false)); - function2.AddParameter("param3", EdmCoreModel.Instance.GetString(false)); model.AddElement(function2); + // Overloaded function 2 + EdmFunction function3 = new("NS", "MyFunction2", EdmCoreModel.Instance.GetString(false), true, null, false); + function3.AddParameter("entity2", new EdmEntityTypeReference(customer, false)); + model.AddElement(function3); + + // Overloaded function 2 + EdmFunction function4 = new("NS", "MyFunction2", EdmCoreModel.Instance.GetString(false), true, null, false); + function4.AddParameter("entity2", new EdmEntityTypeReference(customer, false)); + function4.AddParameter("param", EdmCoreModel.Instance.GetString(false)); + model.AddElement(function4); + EdmEntityContainer container = new("NS", "Default"); EdmEntitySet customers = new(container, "Customers", customer); model.AddElement(container); @@ -337,24 +344,51 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati }; ODataContext context = new(model, settings); - ODataPath path = new(new ODataNavigationSourceSegment(customers), + ODataPath path1 = new(new ODataNavigationSourceSegment(customers), new ODataKeySegment(customer), - new ODataOperationSegment(function), - new ODataOperationSegment(function2)); + new ODataOperationSegment(function1), + new ODataOperationSegment(function3)); + + ODataPath path2 = new(new ODataNavigationSourceSegment(customers), + new ODataKeySegment(customer), + new ODataOperationSegment(function1), + new ODataOperationSegment(function4)); + + ODataPath path3 = new(new ODataNavigationSourceSegment(customers), + new ODataKeySegment(customer), + new ODataOperationSegment(function2), + new ODataOperationSegment(function3)); + + ODataPath path4 = new(new ODataNavigationSourceSegment(customers), + new ODataKeySegment(customer), + new ODataOperationSegment(function2), + new ODataOperationSegment(function4)); // Act - var operation = _operationHandler.CreateOperation(context, path); + var operation1 = _operationHandler.CreateOperation(context, path1); + var operation2 = _operationHandler.CreateOperation(context, path2); + var operation3 = _operationHandler.CreateOperation(context, path3); + var operation4 = _operationHandler.CreateOperation(context, path4); // Assert - Assert.NotNull(operation); + Assert.NotNull(operation1); + Assert.NotNull(operation2); + Assert.NotNull(operation3); + Assert.NotNull(operation4); if (enableOperationId) { - Assert.Equal("Customers.Customer.MyFunction.MyFunction2-df74", operation.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-c53d", operation1.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-4d93", operation2.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-a2b2", operation3.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-7bea", operation4.OperationId); } else { - Assert.Null(operation.OperationId); + Assert.Null(operation1.OperationId); + Assert.Null(operation2.OperationId); + Assert.Null(operation3.OperationId); + Assert.Null(operation4.OperationId); } } From 4c8eafa292f687d054ee4df3676576bdcde82ffd Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 13:06:45 -0500 Subject: [PATCH 25/52] chore: fix merge issue --- .../Operation/EdmOperationOperationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index d944fcf7b..f1d51875a 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -109,7 +109,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) // Hash the segment to avoid duplicate operationIds pathHash = string.IsNullOrEmpty(pathHash) ? opSegment.GetPathHash(Context.Settings) - : (pathHash + opSegment.GetPathHash(Context.Settings)).GetHashSHA256()[..4]; + : (pathHash + opSegment.GetPathHash(Context.Settings)).GetHashSHA256().Substring(0, 4); } identifiers.Add(segment.Identifier); From a54a920c449019d4b4c92a91ea981a7ca3e2ab72 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 24 Dec 2024 13:31:56 -0500 Subject: [PATCH 26/52] chore: bumps version for release Signed-off-by: Vincent Biret --- .../Microsoft.OpenAPI.OData.Reader.csproj | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 8d138498f..f7f893db1 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,14 +15,17 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.6.9 + 1.7.0 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - - Adds support for configuring composable functions generations #551 - + - Updates tag names for actions/functions operations #627 + - Adds nullable to double schema conversion #628 + - Updates PUT operation ID prefix from Update to Set #629 + - Ensures unique operation IDs for composable functions #630 + Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ From 699fd3ebf4c32d0f090420d221cec0577bf5292c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 2 Jan 2025 13:14:59 +0000 Subject: [PATCH 27/52] fix: removes unused constant Signed-off-by: GitHub --- src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs b/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs index 0c1e2ffa2..6f24d5a46 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Common/Constants.cs @@ -167,12 +167,6 @@ internal static class Constants /// public static string StringType = "string"; - /// - /// integer type - /// - [Obsolete("integer is not a valid OpenAPI type. Use number instead.")] - public static string IntegerType = "integer"; - /// /// number type /// From 703ec19988d99e789241e91ebca4f8908c1e444d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 2 Jan 2025 08:18:08 -0500 Subject: [PATCH 28/52] nit: fixes alignment --- .../Microsoft.OpenAPI.OData.Reader.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index f7f893db1..54adaa182 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -23,7 +23,7 @@ - Updates tag names for actions/functions operations #627 - Adds nullable to double schema conversion #628 - - Updates PUT operation ID prefix from Update to Set #629 + - Updates PUT operation ID prefix from Update to Set #629 - Ensures unique operation IDs for composable functions #630 Microsoft.OpenApi.OData.Reader From f7611ae9ad399672a28653fe6173bc8e506a3d16 Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 15 Jan 2025 12:20:05 +0300 Subject: [PATCH 29/52] Fixes potential duplicate operation ids of navigation property paths with overloaded composable functions (#597) --- .../Common/EdmModelHelper.cs | 121 +++++++++++------- .../Microsoft.OpenAPI.OData.Reader.csproj | 9 +- .../ComplexPropertyGetOperationHandler.cs | 2 +- .../ComplexPropertyPostOperationHandler.cs | 2 +- .../ComplexPropertyUpdateOperationHandler.cs | 2 +- .../DollarCountGetOperationHandler.cs | 6 +- .../NavigationPropertyOperationHandler.cs | 2 +- .../ODataTypeCastGetOperationHandler.cs | 2 +- ...igationPropertyGetOperationHandlerTests.cs | 64 +++++++++ 9 files changed, 152 insertions(+), 58 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs b/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs index d636fa0da..030baba10 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Common/EdmModelHelper.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography.X509Certificates; using Microsoft.OData.Edm; using Microsoft.OData.Edm.Csdl; using Microsoft.OData.Edm.Vocabularies; @@ -93,38 +94,40 @@ internal static bool NavigationRestrictionsAllowsNavigability( /// Generates the operation id from a navigation property path. /// /// The target . + /// The OData context. /// Optional: Identifier indicating whether it is a collection-valued non-indexed or single-valued navigation property. /// The operation id generated from the given navigation property path. - internal static string GenerateNavigationPropertyPathOperationId(ODataPath path, string prefix = null) + internal static string GenerateNavigationPropertyPathOperationId(ODataPath path, ODataContext context, string prefix = null) { - IList items = RetrieveNavigationPropertyPathsOperationIdSegments(path); + IList items = RetrieveNavigationPropertyPathsOperationIdSegments(path, context); if (!items.Any()) return null; - int lastItemIndex = items.Count - 1; + int lastItemIndex = items[items.Count-1].StartsWith("-") ? items.Count - 2 : items.Count - 1; if (!string.IsNullOrEmpty(prefix)) { - items[lastItemIndex] = prefix + Utils.UpperFirstChar(items.Last()); + items[lastItemIndex] = prefix + Utils.UpperFirstChar(items[lastItemIndex]); } else { - items[lastItemIndex] = Utils.UpperFirstChar(items.Last()); + items[lastItemIndex] = Utils.UpperFirstChar(items[lastItemIndex]); } - return string.Join(".", items); + return GenerateNavigationPropertyPathOperationId(items); } /// /// Generates the operation id from a complex property path. /// /// The target . + /// The OData context. /// Optional: Identifier indicating whether it is a collection-valued or single-valued complex property. /// The operation id generated from the given complex property path. - internal static string GenerateComplexPropertyPathOperationId(ODataPath path, string prefix = null) + internal static string GenerateComplexPropertyPathOperationId(ODataPath path, ODataContext context, string prefix = null) { - IList items = RetrieveNavigationPropertyPathsOperationIdSegments(path); + IList items = RetrieveNavigationPropertyPathsOperationIdSegments(path, context); if (!items.Any()) return null; @@ -141,15 +144,29 @@ internal static string GenerateComplexPropertyPathOperationId(ODataPath path, st items.Add(Utils.UpperFirstChar(lastSegment?.Identifier)); } - return string.Join(".", items); + return GenerateNavigationPropertyPathOperationId(items); + } + + /// + /// Generates a navigation property operation id from a list of string values. + /// + /// The list of string values. + /// The generated navigation property operation id. + private static string GenerateNavigationPropertyPathOperationId(IList items) + { + if (!items.Any()) + return null; + + return string.Join(".", items).Replace(".-", "-"); // Format any hashed value appropriately (this will be the last value) } /// /// Retrieves the segments of an operation id generated from a navigation property path. /// /// The target . + /// The OData context. /// The segments of an operation id generated from the given navigation property path. - internal static IList RetrieveNavigationPropertyPathsOperationIdSegments(ODataPath path) + internal static IList RetrieveNavigationPropertyPathsOperationIdSegments(ODataPath path, ODataContext context) { Utils.CheckArgumentNull(path, nameof(path)); @@ -173,6 +190,8 @@ s is ODataOperationSegment || Utils.CheckArgumentNull(segments, nameof(segments)); string previousTypeCastSegmentId = null; + string pathHash = string.Empty; + foreach (var segment in segments) { if (segment is ODataNavigationPropertySegment navPropSegment) @@ -189,25 +208,38 @@ s is ODataOperationSegment || previousTypeCastSegmentId = "As" + Utils.UpperFirstChar(schemaElement.Name); items.Add(previousTypeCastSegmentId); } - else if (segment is ODataOperationSegment operationSegment) - { - // Navigation property generated via composable function - items.Add(operationSegment.Identifier); + else if (segment is ODataOperationSegment operationSegment) + { + // Navigation property generated via composable function + if (operationSegment.Operation is IEdmFunction function && context.Model.IsOperationOverload(function)) + { + // Hash the segment to avoid duplicate operationIds + pathHash = string.IsNullOrEmpty(pathHash) + ? operationSegment.GetPathHash(context.Settings) + : (pathHash + operationSegment.GetPathHash(context.Settings)).GetHashSHA256().Substring(0,4); + } + + items.Add(operationSegment.Identifier); } - else if (segment is ODataKeySegment keySegment && keySegment.IsAlternateKey) - { - // We'll consider alternate keys in the operation id to eliminate potential duplicates with operation id of primary path - if (segment == segments.Last()) - { - items.Add("By" + string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x)))); - } - else - { - items.Add(keySegment.Identifier); - } + else if (segment is ODataKeySegment keySegment && keySegment.IsAlternateKey) + { + // We'll consider alternate keys in the operation id to eliminate potential duplicates with operation id of primary path + if (segment == segments.Last()) + { + items.Add("By" + string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x)))); + } + else + { + items.Add(keySegment.Identifier); + } } } + if (!string.IsNullOrEmpty(pathHash)) + { + items.Add("-" + pathHash); + } + return items; } @@ -320,9 +352,10 @@ internal static string GenerateComplexPropertyPathTagName(ODataPath path, ODataC /// Generates the operation id prefix from an OData type cast path. /// /// The target . + /// The OData context. /// Optional: Whether to include the List or Get prefix to the generated operation id. /// The operation id prefix generated from the OData type cast path. - internal static string GenerateODataTypeCastPathOperationIdPrefix(ODataPath path, bool includeListOrGetPrefix = true) + internal static string GenerateODataTypeCastPathOperationIdPrefix(ODataPath path, ODataContext context, bool includeListOrGetPrefix = true) { // Get the segment before the last OData type cast segment ODataTypeCastSegment typeCastSegment = path.Segments.OfType()?.Last(); @@ -352,7 +385,7 @@ internal static string GenerateODataTypeCastPathOperationIdPrefix(ODataPath path if (secondLastSegment is ODataComplexPropertySegment complexSegment) { string listOrGet = includeListOrGetPrefix ? (complexSegment.Property.Type.IsCollection() ? "List" : "Get") : null; - operationId = GenerateComplexPropertyPathOperationId(path, listOrGet); + operationId = GenerateComplexPropertyPathOperationId(path, context, listOrGet); } else if (secondLastSegment is ODataNavigationPropertySegment navPropSegment) { @@ -362,27 +395,27 @@ internal static string GenerateODataTypeCastPathOperationIdPrefix(ODataPath path prefix = navPropSegment?.NavigationProperty.TargetMultiplicity() == EdmMultiplicity.Many ? "List" : "Get"; } - operationId = GenerateNavigationPropertyPathOperationId(path, prefix); + operationId = GenerateNavigationPropertyPathOperationId(path, context, prefix); } else if (secondLastSegment is ODataKeySegment keySegment) { - if (isIndexedCollValuedNavProp) - { - operationId = GenerateNavigationPropertyPathOperationId(path, "Get"); + if (isIndexedCollValuedNavProp) + { + operationId = GenerateNavigationPropertyPathOperationId(path, context, "Get"); + } + else + { + string entityTypeName = keySegment.EntityType.Name; + string getPrefix = includeListOrGetPrefix ? "Get" : null; + string operationName = $"{getPrefix}{Utils.UpperFirstChar(entityTypeName)}"; + if (keySegment.IsAlternateKey) + { + string alternateKeyName = string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x))); + operationName = $"{operationName}By{alternateKeyName}"; + } + operationId = (entitySet != null) ? entitySet.Name : singleton.Name; + operationId += $".{entityTypeName}.{operationName}"; } - else - { - string entityTypeName = keySegment.EntityType.Name; - string getPrefix = includeListOrGetPrefix ? "Get" : null; - string operationName = $"{getPrefix}{Utils.UpperFirstChar(entityTypeName)}"; - if (keySegment.IsAlternateKey) - { - string alternateKeyName = string.Join("", keySegment.Identifier.Split(',').Select(static x => Utils.UpperFirstChar(x))); - operationName = $"{operationName}By{alternateKeyName}"; - } - operationId = (entitySet != null) ? entitySet.Name : singleton.Name; - operationId += $".{entityTypeName}.{operationName}"; - } } else if (secondLastSegment is ODataNavigationSourceSegment) { diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 54adaa182..f35693c80 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,17 +15,14 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.7.0 + 1.7.1 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - - Updates tag names for actions/functions operations #627 - - Adds nullable to double schema conversion #628 - - Updates PUT operation ID prefix from Update to Set #629 - - Ensures unique operation IDs for composable functions #630 - + - Further fix for generating unique operation ids for navigation property paths with composable overloaded functions #596 + Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyGetOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyGetOperationHandler.cs index 072ac9e86..1f8d3124f 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyGetOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyGetOperationHandler.cs @@ -39,7 +39,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) if (Context.Settings.EnableOperationId) { string prefix = ComplexPropertySegment.Property.Type.IsCollection() ? "List" : "Get"; - operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, prefix); + operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, Context, prefix); } // Summary and Description diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs index 50b58e12b..6fd736c64 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyPostOperationHandler.cs @@ -42,7 +42,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) // OperationId if (Context.Settings.EnableOperationId) { - operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, "Set"); + operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, Context, "Set"); } // Summary and Description diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs index 0d3e61e9c..5973f59a3 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ComplexPropertyUpdateOperationHandler.cs @@ -41,7 +41,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) if (Context.Settings.EnableOperationId) { string prefix = OperationType == OperationType.Patch ? "Update" : "Set"; - operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, prefix); + operation.OperationId = EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, Context, prefix); } } diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/DollarCountGetOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/DollarCountGetOperationHandler.cs index 74082736d..0e78ac2ed 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/DollarCountGetOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/DollarCountGetOperationHandler.cs @@ -128,17 +128,17 @@ protected override void SetBasicInfo(OpenApiOperation operation) } else if (SecondLastSegment is ODataNavigationPropertySegment) { - var navPropOpId = string.Join(".", EdmModelHelper.RetrieveNavigationPropertyPathsOperationIdSegments(Path)); + var navPropOpId = string.Join(".", EdmModelHelper.RetrieveNavigationPropertyPathsOperationIdSegments(Path, Context)); operation.OperationId = $"{navPropOpId}.GetCount-{Path.GetPathHash(Context.Settings)}"; } else if (SecondLastSegment is ODataTypeCastSegment odataTypeCastSegment) { IEdmNamedElement targetStructuredType = odataTypeCastSegment.StructuredType as IEdmNamedElement; - operation.OperationId = $"{EdmModelHelper.GenerateODataTypeCastPathOperationIdPrefix(Path, false)}.GetCount.As{Utils.UpperFirstChar(targetStructuredType.Name)}-{Path.GetPathHash(Context.Settings)}"; + operation.OperationId = $"{EdmModelHelper.GenerateODataTypeCastPathOperationIdPrefix(Path, Context, false)}.GetCount.As{Utils.UpperFirstChar(targetStructuredType.Name)}-{Path.GetPathHash(Context.Settings)}"; } else if (SecondLastSegment is ODataComplexPropertySegment) { - operation.OperationId = $"{EdmModelHelper.GenerateComplexPropertyPathOperationId(Path)}.GetCount-{Path.GetPathHash(Context.Settings)}"; + operation.OperationId = $"{EdmModelHelper.GenerateComplexPropertyPathOperationId(Path, Context)}.GetCount-{Path.GetPathHash(Context.Settings)}"; } } diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs index 8bdbacc78..743a10e88 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/NavigationPropertyOperationHandler.cs @@ -107,7 +107,7 @@ protected override void SetExtensions(OpenApiOperation operation) internal string GetOperationId(string prefix = null) { - return EdmModelHelper.GenerateNavigationPropertyPathOperationId(Path, prefix); + return EdmModelHelper.GenerateNavigationPropertyPathOperationId(Path, Context, prefix); } /// diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/ODataTypeCastGetOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/ODataTypeCastGetOperationHandler.cs index 604f31d32..ee30e3e94 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/ODataTypeCastGetOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/ODataTypeCastGetOperationHandler.cs @@ -188,7 +188,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) // OperationId if (Context.Settings.EnableOperationId) - operation.OperationId = EdmModelHelper.GenerateODataTypeCastPathOperationIdPrefix(Path) + $".As{Utils.UpperFirstChar(TargetSchemaElement.Name)}"; + operation.OperationId = EdmModelHelper.GenerateODataTypeCastPathOperationIdPrefix(Path, Context) + $".As{Utils.UpperFirstChar(TargetSchemaElement.Name)}"; base.SetBasicInfo(operation); } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyGetOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyGetOperationHandlerTests.cs index 5e6c401d1..88766ac58 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyGetOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/NavigationPropertyGetOperationHandlerTests.cs @@ -131,6 +131,70 @@ public void CreateNavigationGetOperationViaComposableFunctionReturnsCorrectOpera Assert.Contains(operation.Parameters, x => x.Name == "path"); } + [Fact] + public void CreateNavigationGetOperationViaOverloadedComposableFunctionReturnsCorrectOperation() + { + // Arrange + IEdmModel model = EdmModelHelper.GraphBetaModel; + ODataContext context = new(model, new OpenApiConvertSettings() + { + EnableOperationId = true + }); + + IEdmEntitySet drives = model.EntityContainer.FindEntitySet("drives"); + IEdmEntityType drive = model.SchemaElements.OfType().First(c => c.Name == "drive"); + IEdmNavigationProperty items = drive.DeclaredNavigationProperties().First(c => c.Name == "items"); + IEdmEntityType driveItem = model.SchemaElements.OfType().First(c => c.Name == "driveItem"); + IEdmNavigationProperty workbook = driveItem.DeclaredNavigationProperties().First(c => c.Name == "workbook"); + IEdmEntityType workbookEntity = model.SchemaElements.OfType().First(c => c.Name == "workbook"); + IEdmNavigationProperty worksheets = workbookEntity.DeclaredNavigationProperties().First(c => c.Name == "worksheets"); + IEdmEntityType workbookWorksheet = model.SchemaElements.OfType().First(c => c.Name == "workbookWorksheet"); + IEdmOperation usedRangeWithParams = model.SchemaElements.OfType().First(f => f.Name == "usedRange" && f.Parameters.Any(x => x.Name.Equals("valuesOnly"))); + IEdmOperation usedRange = model.SchemaElements.OfType().First(f => f.Name == "usedRange" && f.Parameters.Count() == 1); + IEdmEntityType workbookRange = model.SchemaElements.OfType().First(c => c.Name == "workbookRange"); + IEdmNavigationProperty format = workbookRange.DeclaredNavigationProperties().First(c => c.Name == "format"); + + + ODataPath path1 = new(new ODataNavigationSourceSegment(drives), + new ODataKeySegment(drive), + new ODataNavigationPropertySegment(items), + new ODataKeySegment(driveItem), + new ODataNavigationPropertySegment(workbook), + new ODataNavigationPropertySegment(worksheets), + new ODataKeySegment(workbookWorksheet), + new ODataOperationSegment(usedRangeWithParams), + new ODataNavigationPropertySegment(format)); + + ODataPath path2 = new(new ODataNavigationSourceSegment(drives), + new ODataKeySegment(drive), + new ODataNavigationPropertySegment(items), + new ODataKeySegment(driveItem), + new ODataNavigationPropertySegment(workbook), + new ODataNavigationPropertySegment(worksheets), + new ODataKeySegment(workbookWorksheet), + new ODataOperationSegment(usedRange), + new ODataNavigationPropertySegment(format)); + + // Act + var operation1 = _operationHandler.CreateOperation(context, path1); + var operation2 = _operationHandler.CreateOperation(context, path2); + + // Assert + Assert.NotNull(operation1); + Assert.NotNull(operation2); + + Assert.Equal("drives.items.workbook.worksheets.usedRange.GetFormat-206d", operation1.OperationId); + Assert.Equal("drives.items.workbook.worksheets.usedRange.GetFormat-ec2c", operation2.OperationId); + + Assert.NotNull(operation1.Parameters); + Assert.Equal(6, operation1.Parameters.Count); + Assert.Contains(operation1.Parameters, x => x.Name == "valuesOnly"); + + Assert.NotNull(operation2.Parameters); + Assert.Equal(5, operation2.Parameters.Count); + Assert.DoesNotContain(operation2.Parameters, x => x.Name == "valuesOnly"); + } + [Theory] [InlineData(true)] [InlineData(false)] From 864681851686d38fa79d503bbd96b28eacf77ef5 Mon Sep 17 00:00:00 2001 From: Irvine Sunday <40403681+irvinesunday@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:54:45 +0300 Subject: [PATCH 30/52] Updates tag names for actions/functions operations (#586) * Update operation tags generation * Refactor operation tag generation * Update unit tests * Update integration test files * Update release note * Update src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs Co-authored-by: Andrew Omondi * Account for nullability * Remove unnecessary code --------- Co-authored-by: Andrew Omondi --- .../Microsoft.OpenAPI.OData.Reader.csproj | 9 ++++-- .../Operation/EdmOperationOperationHandler.cs | 29 ++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index f35693c80..fa89fa83e 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -21,8 +21,13 @@ Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - - Further fix for generating unique operation ids for navigation property paths with composable overloaded functions #596 - + - Upgraded to Microsoft.Odata.Edm 8.0.0 + - Cleaned up obsolete APIs + - Changed target framework to net8.0 + - Adds support for retrieving collection of enum values from UpdateMethod property of UpdateRestrictions annotation #564 + - Adds nullable to double schema conversions #581 + - Updates tag names for actions/functions operations #585 + Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index d5e1f5554..55ad88b21 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -81,7 +81,6 @@ protected override void SetBasicInfo(OpenApiOperation operation) // duplicates in entity vs entityset functions/actions List identifiers = new(); - string pathHash = string.Empty; foreach (ODataSegment segment in Path.Segments) { if (segment is ODataKeySegment keySegment) @@ -102,18 +101,6 @@ protected override void SetBasicInfo(OpenApiOperation operation) identifiers.Add(keySegment.Identifier); } } - else if (segment is ODataOperationSegment opSegment) - { - if (opSegment.Operation is IEdmFunction function && Context.Model.IsOperationOverload(function)) - { - // Hash the segment to avoid duplicate operationIds - pathHash = string.IsNullOrEmpty(pathHash) - ? opSegment.GetPathHash(Context.Settings) - : (pathHash + opSegment.GetPathHash(Context.Settings)).GetHashSHA256().Substring(0, 4); - } - - identifiers.Add(segment.Identifier); - } else { identifiers.Add(segment.Identifier); @@ -122,13 +109,21 @@ protected override void SetBasicInfo(OpenApiOperation operation) string operationId = string.Join(".", identifiers); - if (!string.IsNullOrEmpty(pathHash)) + if (EdmOperation.IsAction()) { - operation.OperationId = operationId + "-" + pathHash; + operation.OperationId = operationId; } else { - operation.OperationId = operationId; + if (Path.LastSegment is ODataOperationSegment operationSegment && + Context.Model.IsOperationOverload(operationSegment.Operation)) + { + operation.OperationId = operationId + "-" + Path.LastSegment.GetPathHash(Context.Settings); + } + else + { + operation.OperationId = operationId; + } } } @@ -174,7 +169,7 @@ private void GenerateTagName(out string tagName, int skip = 1) break; // ODataNavigationSourceSegment default: - tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name; + tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; break; } } From 284ad67df2b90c2bb788bf80ab034969d934d603 Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Fri, 17 Jan 2025 16:52:05 +0300 Subject: [PATCH 31/52] Adds action/function suffix to tag names for action/function operations --- .../Operation/EdmOperationOperationHandler.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 55ad88b21..c7bc342c4 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -147,7 +147,7 @@ protected override void SetTags(OpenApiOperation operation) } /// - /// Genrates the tag name for the operation. + /// Genrates the tag name for the operation. Adds Action or Function name to the tag name if the operation is an action or function. /// /// The generated tag name. /// The number of segments to skip. @@ -160,14 +160,25 @@ private void GenerateTagName(out string tagName, int skip = 1) case ODataNavigationPropertySegment: tagName = EdmModelHelper.GenerateNavigationPropertyPathTagName(Path, Context); break; - case ODataOperationSegment: case ODataOperationImportSegment: // Previous segmment could be a navigation property or a navigation source segment case ODataKeySegment: skip += 1; GenerateTagName(out tagName, skip); break; - // ODataNavigationSourceSegment + // If the operation is a function or action, append the word "Function" or "Action" to the tag name + case ODataOperationSegment operationSegment: + tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + if(operationSegment.Operation.IsAction()) + { + tagName += ".Actions"; + } + + if(operationSegment.Operation.IsFunction()) + { + tagName += ".Functions"; + } + break; default: tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; break; From b8082325bcdd56f6425d2b883334f2b12aa3e1d8 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 20 Jan 2025 09:13:20 +0300 Subject: [PATCH 32/52] Update src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs Co-authored-by: Vincent Biret --- .../Operation/EdmOperationOperationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index c7bc342c4..03efc1c8c 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -168,7 +168,7 @@ private void GenerateTagName(out string tagName, int skip = 1) break; // If the operation is a function or action, append the word "Function" or "Action" to the tag name case ODataOperationSegment operationSegment: - tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name; if(operationSegment.Operation.IsAction()) { tagName += ".Actions"; From e6cc1f36a94db43790ebec1654fb761d5076d320 Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Mon, 20 Jan 2025 09:15:48 +0300 Subject: [PATCH 33/52] Fixed method name --- .../Operation/EdmOperationOperationHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 03efc1c8c..855e78da6 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -180,7 +180,7 @@ private void GenerateTagName(out string tagName, int skip = 1) } break; default: - tagName = NavigationSource.Name + "." + NavigationSource.EntityType.Name; + tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name; break; } } From 5dd584b7fe4ea8fe67adae3d650966bfcc94989c Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Mon, 20 Jan 2025 09:23:51 +0300 Subject: [PATCH 34/52] Reverted back changes and added release notes --- .../Microsoft.OpenAPI.OData.Reader.csproj | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index fa89fa83e..d8b324206 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,19 +15,14 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.7.1 + 1.7.2 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - - Upgraded to Microsoft.Odata.Edm 8.0.0 - - Cleaned up obsolete APIs - - Changed target framework to net8.0 - - Adds support for retrieving collection of enum values from UpdateMethod property of UpdateRestrictions annotation #564 - - Adds nullable to double schema conversions #581 - - Updates tag names for actions/functions operations #585 - + - Adds action/function suffix to tag names for actions/functions operations in #642 + Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ @@ -71,4 +66,4 @@ - + \ No newline at end of file From e74cc849e43dca73a35ac8d8a478d095b469a23d Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Mon, 20 Jan 2025 09:37:37 +0300 Subject: [PATCH 35/52] Updated expected test result --- .../EdmFunctionOperationHandlerTests.cs | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index d1b0c2fc1..bd8569759 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -378,7 +378,7 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati if (enableOperationId) { - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-c53d", operation1.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-6b6d", operation1.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-4d93", operation2.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-a2b2", operation3.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-7bea", operation4.OperationId); @@ -575,35 +575,35 @@ public void CreateOperationForFunctionWithDateTimeParametersReturnsCorrectPathIt } [Fact] - public void CreateFunctionOperationWithAlternateKeyReturnsCorrectOperationId() - { - // Arrange + public void CreateFunctionOperationWithAlternateKeyReturnsCorrectOperationId() + { + // Arrange IEdmModel model = EdmModelHelper.GraphBetaModel; - ODataContext context = new(model, new OpenApiConvertSettings() + ODataContext context = new(model, new OpenApiConvertSettings() { - EnableOperationId = true + EnableOperationId = true }); - IEdmSingleton singleton = model.EntityContainer.FindSingleton("communications"); - IEdmEntityType entityType = model.SchemaElements.OfType().First(c => c.Name == "cloudCommunications"); - IEdmNavigationProperty navProp = entityType.DeclaredNavigationProperties().First(c => c.Name == "onlineMeetings"); - IEdmOperation action = model.SchemaElements.OfType().First(f => f.Name == "sendVirtualAppointmentReminderSms"); - IDictionary keyMappings = new Dictionary { { "joinWebUrl", "joinWebUrl" } }; - - ODataPath path = new(new ODataNavigationSourceSegment(singleton), - new ODataNavigationPropertySegment(navProp), - new ODataKeySegment(entityType, keyMappings) - { - IsAlternateKey = true - }, - new ODataOperationSegment(action)); - + IEdmSingleton singleton = model.EntityContainer.FindSingleton("communications"); + IEdmEntityType entityType = model.SchemaElements.OfType().First(c => c.Name == "cloudCommunications"); + IEdmNavigationProperty navProp = entityType.DeclaredNavigationProperties().First(c => c.Name == "onlineMeetings"); + IEdmOperation action = model.SchemaElements.OfType().First(f => f.Name == "sendVirtualAppointmentReminderSms"); + IDictionary keyMappings = new Dictionary { { "joinWebUrl", "joinWebUrl" } }; + + ODataPath path = new(new ODataNavigationSourceSegment(singleton), + new ODataNavigationPropertySegment(navProp), + new ODataKeySegment(entityType, keyMappings) + { + IsAlternateKey = true + }, + new ODataOperationSegment(action)); + // Act - var operation = _operationHandler.CreateOperation(context, path); - - // Assert - Assert.NotNull(operation); - Assert.Equal("communications.onlineMeetings.joinWebUrl.sendVirtualAppointmentReminderSms", operation.OperationId); + var operation = _operationHandler.CreateOperation(context, path); + + // Assert + Assert.NotNull(operation); + Assert.Equal("communications.onlineMeetings.joinWebUrl.sendVirtualAppointmentReminderSms", operation.OperationId); } } -} +} \ No newline at end of file From d5beb7cfde2c8c25e7352466edd15a645f968b6a Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Mon, 20 Jan 2025 09:41:45 +0300 Subject: [PATCH 36/52] Rectified expected test result --- .../Operation/EdmFunctionOperationHandlerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index bd8569759..2db6f6b10 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -379,7 +379,7 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati if (enableOperationId) { Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-6b6d", operation1.OperationId); - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-4d93", operation2.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-2636", operation2.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-a2b2", operation3.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-7bea", operation4.OperationId); } From 3b4b0d15706308b6d73f9ddfd7b6f7d923413104 Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Mon, 20 Jan 2025 09:52:34 +0300 Subject: [PATCH 37/52] Rectified expected test result --- .../Operation/EdmFunctionOperationHandlerTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index 2db6f6b10..da9332623 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -380,8 +380,8 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati { Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-6b6d", operation1.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-2636", operation2.OperationId); - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-a2b2", operation3.OperationId); - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-7bea", operation4.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-6b6d", operation3.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-2636", operation4.OperationId); } else { From 494f30291599f30f98fb72b168e87ef6457a1ebc Mon Sep 17 00:00:00 2001 From: Microsoft Graph DevX Tooling Date: Mon, 20 Jan 2025 12:14:24 +0300 Subject: [PATCH 38/52] Updated operation handler to make use of EDMOperation object instead of using Odata operation segment. Updated test files and regenerated yaml and json resource files --- .../Operation/EdmOperationOperationHandler.cs | 22 +++---- .../EdmActionOperationHandlerTests.cs | 4 +- .../EdmFunctionOperationHandlerTests.cs | 4 +- .../Resources/Multiple.Schema.OpenApi.V2.json | 12 +++- .../Resources/Multiple.Schema.OpenApi.V2.yaml | 8 ++- .../Resources/Multiple.Schema.OpenApi.json | 12 +++- .../Resources/Multiple.Schema.OpenApi.yaml | 8 ++- .../Resources/TripService.OpenApi.V2.json | 60 +++++++++++++------ .../Resources/TripService.OpenApi.V2.yaml | 48 +++++++++------ .../Resources/TripService.OpenApi.json | 60 +++++++++++++------ .../Resources/TripService.OpenApi.yaml | 48 +++++++++------ 11 files changed, 189 insertions(+), 97 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index 855e78da6..a9b5ebacd 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -85,7 +85,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) { if (segment is ODataKeySegment keySegment) { - if (!keySegment.IsAlternateKey) + if (!keySegment.IsAlternateKey) { identifiers.Add(segment.EntityType.Name); continue; @@ -152,7 +152,7 @@ protected override void SetTags(OpenApiOperation operation) /// The generated tag name. /// The number of segments to skip. private void GenerateTagName(out string tagName, int skip = 1) - { + { var targetSegment = Path.Segments.Reverse().Skip(skip).FirstOrDefault(); switch (targetSegment) @@ -166,21 +166,17 @@ private void GenerateTagName(out string tagName, int skip = 1) skip += 1; GenerateTagName(out tagName, skip); break; - // If the operation is a function or action, append the word "Function" or "Action" to the tag name - case ODataOperationSegment operationSegment: + default: tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name; - if(operationSegment.Operation.IsAction()) + if (EdmOperation.IsAction()) { tagName += ".Actions"; } - - if(operationSegment.Operation.IsFunction()) + else if (EdmOperation.IsFunction()) { tagName += ".Functions"; } - break; - default: - tagName = NavigationSource.Name + "." + NavigationSource.EntityType().Name; + break; } } @@ -198,7 +194,7 @@ protected override void SetParameters(OpenApiOperation operation) } /// - protected override void SetResponses(OpenApiOperation operation) + protected override void SetResponses(OpenApiOperation operation) { operation.Responses = Context.CreateResponses(EdmOperation); base.SetResponses(operation); @@ -298,10 +294,10 @@ protected override void SetCustomLinkRelType() { LinkRelKey key = EdmOperation.IsAction() ? LinkRelKey.Action : LinkRelKey.Function; Context.Settings.CustomHttpMethodLinkRelMapping.TryGetValue(key, out string linkRelValue); - CustomLinkRel = linkRelValue; + CustomLinkRel = linkRelValue; } } - + /// protected override void SetExternalDocs(OpenApiOperation operation) { diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs index dca92aebe..f664f0d86 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmActionOperationHandlerTests.cs @@ -40,7 +40,7 @@ public void CreateOperationForEdmActionReturnsCorrectOperation() Assert.Equal("Details of the shared trip.", operation.Description); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal("People.Person", tag.Name); + Assert.Equal("People.Person.Actions", tag.Name); Assert.NotNull(operation.Parameters); Assert.Single(operation.Parameters); @@ -79,7 +79,7 @@ public void CreateOperationForEdmActionReturnsCorrectOperationHierarchicalClass( Assert.Equal($"Invoke action {actionName}", operation.Summary); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal($"{entitySetName}.AccountApiModel", tag.Name); + Assert.Equal($"{entitySetName}.AccountApiModel.Actions", tag.Name); Assert.NotNull(operation.Parameters); Assert.Single(operation.Parameters); diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index da9332623..dd0fa6bac 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -100,7 +100,7 @@ public void CreateOperationForEdmFunctionReturnsCorrectOperation(bool useHTTPSta Assert.Equal("Invoke function GetFavoriteAirline", operation.Summary); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal("People.Person", tag.Name); + Assert.Equal("People.Person.Functions", tag.Name); Assert.NotNull(operation.Parameters); Assert.Single(operation.Parameters); @@ -138,7 +138,7 @@ public void CreateOperationForEdmFunctionReturnsCorrectOperationHierarchicalClas Assert.Equal("Collection of contract attachments.", operation.Description); Assert.NotNull(operation.Tags); var tag = Assert.Single(operation.Tags); - Assert.Equal($"{entitySetName}.AccountApiModel", tag.Name); + Assert.Equal($"{entitySetName}.AccountApiModel.Functions", tag.Name); Assert.NotNull(operation.Parameters); Assert.Equal(6, operation.Parameters.Count); // id, top, skip, count, search, filter diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json index 4626b31e2..49e62c4ea 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json @@ -591,7 +591,7 @@ "/Documents({Id})/Default.Upload": { "post": { "tags": [ - "Documents.DocumentDto" + "Documents.DocumentDto.Actions" ], "summary": "Invoke action Upload", "operationId": "Documents.DocumentDto.Upload", @@ -3519,7 +3519,7 @@ "/Tasks({Id})/Default.Upload": { "post": { "tags": [ - "Tasks.DocumentDto" + "Tasks.DocumentDto.Actions" ], "summary": "Invoke action Upload", "operationId": "Tasks.DocumentDto.Upload", @@ -6275,6 +6275,10 @@ "name": "Documents.DocumentDto", "x-ms-docs-toc-type": "page" }, + { + "name": "Documents.DocumentDto.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "Documents.RevisionDto", "x-ms-docs-toc-type": "page" @@ -6315,6 +6319,10 @@ "name": "Tasks.DocumentDto", "x-ms-docs-toc-type": "page" }, + { + "name": "Tasks.DocumentDto.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "Tasks.RevisionDto", "x-ms-docs-toc-type": "page" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml index ffb97bf38..37ae6c97d 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.yaml @@ -413,7 +413,7 @@ paths: '/Documents({Id})/Default.Upload': post: tags: - - Documents.DocumentDto + - Documents.DocumentDto.Actions summary: Invoke action Upload operationId: Documents.DocumentDto.Upload parameters: @@ -2495,7 +2495,7 @@ paths: '/Tasks({Id})/Default.Upload': post: tags: - - Tasks.DocumentDto + - Tasks.DocumentDto.Actions summary: Invoke action Upload operationId: Tasks.DocumentDto.Upload parameters: @@ -4545,6 +4545,8 @@ tags: x-ms-docs-toc-type: page - name: Documents.DocumentDto x-ms-docs-toc-type: page + - name: Documents.DocumentDto.Actions + x-ms-docs-toc-type: container - name: Documents.RevisionDto x-ms-docs-toc-type: page - name: Documents.DocumentTagRelDto @@ -4565,6 +4567,8 @@ tags: x-ms-docs-toc-type: page - name: Tasks.DocumentDto x-ms-docs-toc-type: page + - name: Tasks.DocumentDto.Actions + x-ms-docs-toc-type: container - name: Tasks.RevisionDto x-ms-docs-toc-type: page - name: Tasks.DocumentTagRelDto diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json index e6af74cf0..02c621bad 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.json @@ -663,7 +663,7 @@ "description": "Provides operations to call the Upload method.", "post": { "tags": [ - "Documents.DocumentDto" + "Documents.DocumentDto.Actions" ], "summary": "Invoke action Upload", "operationId": "Documents.DocumentDto.Upload", @@ -3940,7 +3940,7 @@ "description": "Provides operations to call the Upload method.", "post": { "tags": [ - "Tasks.DocumentDto" + "Tasks.DocumentDto.Actions" ], "summary": "Invoke action Upload", "operationId": "Tasks.DocumentDto.Upload", @@ -7481,6 +7481,10 @@ "name": "Documents.DocumentDto", "x-ms-docs-toc-type": "page" }, + { + "name": "Documents.DocumentDto.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "Documents.RevisionDto", "x-ms-docs-toc-type": "page" @@ -7521,6 +7525,10 @@ "name": "Tasks.DocumentDto", "x-ms-docs-toc-type": "page" }, + { + "name": "Tasks.DocumentDto.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "Tasks.RevisionDto", "x-ms-docs-toc-type": "page" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml index cd3fc34e0..fae5ab931 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.yaml @@ -460,7 +460,7 @@ paths: description: Provides operations to call the Upload method. post: tags: - - Documents.DocumentDto + - Documents.DocumentDto.Actions summary: Invoke action Upload operationId: Documents.DocumentDto.Upload parameters: @@ -2771,7 +2771,7 @@ paths: description: Provides operations to call the Upload method. post: tags: - - Tasks.DocumentDto + - Tasks.DocumentDto.Actions summary: Invoke action Upload operationId: Tasks.DocumentDto.Upload parameters: @@ -5384,6 +5384,8 @@ tags: x-ms-docs-toc-type: page - name: Documents.DocumentDto x-ms-docs-toc-type: page + - name: Documents.DocumentDto.Actions + x-ms-docs-toc-type: container - name: Documents.RevisionDto x-ms-docs-toc-type: page - name: Documents.DocumentTagRelDto @@ -5404,6 +5406,8 @@ tags: x-ms-docs-toc-type: page - name: Tasks.DocumentDto x-ms-docs-toc-type: page + - name: Tasks.DocumentDto.Actions + x-ms-docs-toc-type: container - name: Tasks.RevisionDto x-ms-docs-toc-type: page - name: Tasks.DocumentTagRelDto diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json index 2d2dfadba..609eb6e09 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.json @@ -7696,7 +7696,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { "get": { "tags": [ - "Me.Person" + "Me.Person.Functions" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "Me.GetFavoriteAirline", @@ -7722,7 +7722,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": { "get": { "tags": [ - "Me.Person" + "Me.Person.Functions" ], "summary": "Invoke function GetFriendsTrips", "operationId": "Me.GetFriendsTrips", @@ -7799,7 +7799,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { "post": { "tags": [ - "Me.Person" + "Me.Person.Actions" ], "summary": "Invoke action GetPeersForTrip", "operationId": "Me.GetPeersForTrip", @@ -10930,7 +10930,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire": { "post": { "tags": [ - "Me.Person" + "Me.Person.Actions" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -11768,7 +11768,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "Me.Person" + "Me.Person.Actions" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -11800,7 +11800,7 @@ "/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": { "get": { "tags": [ - "Me.Person" + "Me.Person.Functions" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "Me.UpdatePersonLastName", @@ -15601,7 +15601,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { "get": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Functions" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "NewComePeople.Person.GetFavoriteAirline", @@ -15630,7 +15630,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": { "get": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Functions" ], "summary": "Invoke function GetFriendsTrips", "operationId": "NewComePeople.Person.GetFriendsTrips", @@ -15715,7 +15715,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { "post": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Actions" ], "summary": "Invoke action GetPeersForTrip", "operationId": "NewComePeople.Person.GetPeersForTrip", @@ -15747,7 +15747,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire": { "post": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Actions" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -15794,7 +15794,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Actions" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -15827,7 +15827,7 @@ "/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": { "get": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Functions" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "NewComePeople.Person.UpdatePersonLastName", @@ -24492,7 +24492,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()": { "get": { "tags": [ - "People.Person" + "People.Person.Functions" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "People.Person.GetFavoriteAirline", @@ -24528,7 +24528,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName='{userName}')": { "get": { "tags": [ - "People.Person" + "People.Person.Functions" ], "summary": "Invoke function GetFriendsTrips", "operationId": "People.Person.GetFriendsTrips", @@ -24613,7 +24613,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip": { "post": { "tags": [ - "People.Person" + "People.Person.Actions" ], "summary": "Invoke action GetPeersForTrip", "operationId": "People.Person.GetPeersForTrip", @@ -28312,7 +28312,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire": { "post": { "tags": [ - "People.Person" + "People.Person.Actions" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -29262,7 +29262,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip": { "post": { "tags": [ - "People.Person" + "People.Person.Actions" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -29302,7 +29302,7 @@ "/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName='{lastName}')": { "get": { "tags": [ - "People.Person" + "People.Person.Functions" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "People.Person.UpdatePersonLastName", @@ -31840,6 +31840,14 @@ "name": "Me.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, + { + "name": "Me.Person.Functions", + "x-ms-docs-toc-type": "container" + }, + { + "name": "Me.Person.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "NewComePeople.Person", "x-ms-docs-toc-type": "page" @@ -31852,6 +31860,14 @@ "name": "NewComePeople.Person.Location", "x-ms-docs-toc-type": "page" }, + { + "name": "NewComePeople.Person.Functions", + "x-ms-docs-toc-type": "container" + }, + { + "name": "NewComePeople.Person.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "NewComePeople.Trip", "x-ms-docs-toc-type": "page" @@ -31880,6 +31896,14 @@ "name": "People.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, + { + "name": "People.Person.Functions", + "x-ms-docs-toc-type": "container" + }, + { + "name": "People.Person.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "ResetDataSource", "x-ms-docs-toc-type": "container" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml index a725e263c..d03261ed5 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.V2.yaml @@ -5174,7 +5174,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline(): get: tags: - - Me.Person + - Me.Person.Functions summary: Invoke function GetFavoriteAirline operationId: Me.GetFavoriteAirline responses: @@ -5193,7 +5193,7 @@ paths: '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')': get: tags: - - Me.Person + - Me.Person.Functions summary: Invoke function GetFriendsTrips operationId: Me.GetFriendsTrips parameters: @@ -5241,7 +5241,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip: post: tags: - - Me.Person + - Me.Person.Actions summary: Invoke action GetPeersForTrip operationId: Me.GetPeersForTrip parameters: @@ -7352,7 +7352,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire: post: tags: - - Me.Person + - Me.Person.Actions summary: Invoke action Hire description: Hires someone for the company. operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -7927,7 +7927,7 @@ paths: /Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip: post: tags: - - Me.Person + - Me.Person.Actions summary: Invoke action ShareTrip description: Details of the shared trip. operationId: Me.ShareTrip @@ -7949,7 +7949,7 @@ paths: '/Me/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')': get: tags: - - Me.Person + - Me.Person.Functions summary: Invoke function UpdatePersonLastName operationId: Me.UpdatePersonLastName parameters: @@ -10502,7 +10502,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()': get: tags: - - NewComePeople.Person + - NewComePeople.Person.Functions summary: Invoke function GetFavoriteAirline operationId: NewComePeople.Person.GetFavoriteAirline parameters: @@ -10522,7 +10522,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')': get: tags: - - NewComePeople.Person + - NewComePeople.Person.Functions summary: Invoke function GetFriendsTrips operationId: NewComePeople.Person.GetFriendsTrips parameters: @@ -10576,7 +10576,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip': post: tags: - - NewComePeople.Person + - NewComePeople.Person.Actions summary: Invoke action GetPeersForTrip operationId: NewComePeople.Person.GetPeersForTrip parameters: @@ -10597,7 +10597,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire': post: tags: - - NewComePeople.Person + - NewComePeople.Person.Actions summary: Invoke action Hire description: Hires someone for the company. operationId: NewComePeople.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -10629,7 +10629,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip': post: tags: - - NewComePeople.Person + - NewComePeople.Person.Actions summary: Invoke action ShareTrip description: Details of the shared trip. operationId: NewComePeople.Person.ShareTrip @@ -10651,7 +10651,7 @@ paths: '/NewComePeople/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')': get: tags: - - NewComePeople.Person + - NewComePeople.Person.Functions summary: Invoke function UpdatePersonLastName operationId: NewComePeople.Person.UpdatePersonLastName parameters: @@ -16576,7 +16576,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFavoriteAirline()': get: tags: - - People.Person + - People.Person.Functions summary: Invoke function GetFavoriteAirline operationId: People.Person.GetFavoriteAirline parameters: @@ -16602,7 +16602,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetFriendsTrips(userName=''{userName}'')': get: tags: - - People.Person + - People.Person.Functions summary: Invoke function GetFriendsTrips operationId: People.Person.GetFriendsTrips parameters: @@ -16656,7 +16656,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.GetPeersForTrip': post: tags: - - People.Person + - People.Person.Actions summary: Invoke action GetPeersForTrip operationId: People.Person.GetPeersForTrip parameters: @@ -19189,7 +19189,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager/Microsoft.OData.Service.Sample.TrippinInMemory.Models.Hire': post: tags: - - People.Person + - People.Person.Actions summary: Invoke action Hire description: Hires someone for the company. operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -19848,7 +19848,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.ShareTrip': post: tags: - - People.Person + - People.Person.Actions summary: Invoke action ShareTrip description: Details of the shared trip. operationId: People.Person.ShareTrip @@ -19876,7 +19876,7 @@ paths: '/People/{UserName}/Microsoft.OData.Service.Sample.TrippinInMemory.Models.UpdatePersonLastName(lastName=''{lastName}'')': get: tags: - - People.Person + - People.Person.Functions summary: Invoke function UpdatePersonLastName operationId: People.Person.UpdatePersonLastName parameters: @@ -21580,12 +21580,20 @@ tags: x-ms-docs-toc-type: page - name: Me.Trips.PlanItem x-ms-docs-toc-type: page + - name: Me.Person.Functions + x-ms-docs-toc-type: container + - name: Me.Person.Actions + x-ms-docs-toc-type: container - name: NewComePeople.Person x-ms-docs-toc-type: page - name: NewComePeople.Location x-ms-docs-toc-type: page - name: NewComePeople.Person.Location x-ms-docs-toc-type: page + - name: NewComePeople.Person.Functions + x-ms-docs-toc-type: container + - name: NewComePeople.Person.Actions + x-ms-docs-toc-type: container - name: NewComePeople.Trip x-ms-docs-toc-type: page - name: NewComePeople.Trips.PlanItem @@ -21600,5 +21608,9 @@ tags: x-ms-docs-toc-type: page - name: People.Trips.PlanItem x-ms-docs-toc-type: page + - name: People.Person.Functions + x-ms-docs-toc-type: container + - name: People.Person.Actions + x-ms-docs-toc-type: container - name: ResetDataSource x-ms-docs-toc-type: container \ No newline at end of file diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json index 8872302d0..146b726dc 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.json @@ -8518,7 +8518,7 @@ "description": "Provides operations to call the GetFavoriteAirline method.", "get": { "tags": [ - "Me.Person" + "Me.Person.Functions" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "Me.GetFavoriteAirline", @@ -8544,7 +8544,7 @@ "description": "Provides operations to call the GetFriendsTrips method.", "get": { "tags": [ - "Me.Person" + "Me.Person.Functions" ], "summary": "Invoke function GetFriendsTrips", "operationId": "Me.GetFriendsTrips", @@ -8638,7 +8638,7 @@ "description": "Provides operations to call the GetPeersForTrip method.", "post": { "tags": [ - "Me.Person" + "Me.Person.Actions" ], "summary": "Invoke action GetPeersForTrip", "operationId": "Me.GetPeersForTrip", @@ -12054,7 +12054,7 @@ "description": "Provides operations to call the Hire method.", "post": { "tags": [ - "Me.Person" + "Me.Person.Actions" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -12990,7 +12990,7 @@ "description": "Provides operations to call the ShareTrip method.", "post": { "tags": [ - "Me.Person" + "Me.Person.Actions" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -13020,7 +13020,7 @@ "description": "Provides operations to call the UpdatePersonLastName method.", "get": { "tags": [ - "Me.Person" + "Me.Person.Functions" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "Me.UpdatePersonLastName", @@ -17309,7 +17309,7 @@ "description": "Provides operations to call the GetFavoriteAirline method.", "get": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Functions" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "NewComePeople.Person.GetFavoriteAirline", @@ -17340,7 +17340,7 @@ "description": "Provides operations to call the GetFriendsTrips method.", "get": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Functions" ], "summary": "Invoke function GetFriendsTrips", "operationId": "NewComePeople.Person.GetFriendsTrips", @@ -17444,7 +17444,7 @@ "description": "Provides operations to call the GetPeersForTrip method.", "post": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Actions" ], "summary": "Invoke action GetPeersForTrip", "operationId": "NewComePeople.Person.GetPeersForTrip", @@ -17478,7 +17478,7 @@ "description": "Provides operations to call the Hire method.", "post": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Actions" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -17534,7 +17534,7 @@ "description": "Provides operations to call the ShareTrip method.", "post": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Actions" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -17569,7 +17569,7 @@ "description": "Provides operations to call the UpdatePersonLastName method.", "get": { "tags": [ - "NewComePeople.Person" + "NewComePeople.Person.Functions" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "NewComePeople.Person.UpdatePersonLastName", @@ -27318,7 +27318,7 @@ "description": "Provides operations to call the GetFavoriteAirline method.", "get": { "tags": [ - "People.Person" + "People.Person.Functions" ], "summary": "Invoke function GetFavoriteAirline", "operationId": "People.Person.GetFavoriteAirline", @@ -27356,7 +27356,7 @@ "description": "Provides operations to call the GetFriendsTrips method.", "get": { "tags": [ - "People.Person" + "People.Person.Functions" ], "summary": "Invoke function GetFriendsTrips", "operationId": "People.Person.GetFriendsTrips", @@ -27460,7 +27460,7 @@ "description": "Provides operations to call the GetPeersForTrip method.", "post": { "tags": [ - "People.Person" + "People.Person.Actions" ], "summary": "Invoke action GetPeersForTrip", "operationId": "People.Person.GetPeersForTrip", @@ -31602,7 +31602,7 @@ "description": "Provides operations to call the Hire method.", "post": { "tags": [ - "People.Person" + "People.Person.Actions" ], "summary": "Invoke action Hire", "description": "Hires someone for the company.", @@ -32682,7 +32682,7 @@ "description": "Provides operations to call the ShareTrip method.", "post": { "tags": [ - "People.Person" + "People.Person.Actions" ], "summary": "Invoke action ShareTrip", "description": "Details of the shared trip.", @@ -32724,7 +32724,7 @@ "description": "Provides operations to call the UpdatePersonLastName method.", "get": { "tags": [ - "People.Person" + "People.Person.Functions" ], "summary": "Invoke function UpdatePersonLastName", "operationId": "People.Person.UpdatePersonLastName", @@ -35875,6 +35875,14 @@ "name": "Me.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, + { + "name": "Me.Person.Functions", + "x-ms-docs-toc-type": "container" + }, + { + "name": "Me.Person.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "NewComePeople.Person", "x-ms-docs-toc-type": "page" @@ -35887,6 +35895,14 @@ "name": "NewComePeople.Person.Location", "x-ms-docs-toc-type": "page" }, + { + "name": "NewComePeople.Person.Functions", + "x-ms-docs-toc-type": "container" + }, + { + "name": "NewComePeople.Person.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "NewComePeople.Trip", "x-ms-docs-toc-type": "page" @@ -35915,6 +35931,14 @@ "name": "People.Trips.PlanItem", "x-ms-docs-toc-type": "page" }, + { + "name": "People.Person.Functions", + "x-ms-docs-toc-type": "container" + }, + { + "name": "People.Person.Actions", + "x-ms-docs-toc-type": "container" + }, { "name": "ResetDataSource", "x-ms-docs-toc-type": "container" diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml index a26b7b902..6773a8b89 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/TripService.OpenApi.yaml @@ -5701,7 +5701,7 @@ paths: description: Provides operations to call the GetFavoriteAirline method. get: tags: - - Me.Person + - Me.Person.Functions summary: Invoke function GetFavoriteAirline operationId: Me.GetFavoriteAirline responses: @@ -5720,7 +5720,7 @@ paths: description: Provides operations to call the GetFriendsTrips method. get: tags: - - Me.Person + - Me.Person.Functions summary: Invoke function GetFriendsTrips operationId: Me.GetFriendsTrips parameters: @@ -5781,7 +5781,7 @@ paths: description: Provides operations to call the GetPeersForTrip method. post: tags: - - Me.Person + - Me.Person.Actions summary: Invoke action GetPeersForTrip operationId: Me.GetPeersForTrip requestBody: @@ -8079,7 +8079,7 @@ paths: description: Provides operations to call the Hire method. post: tags: - - Me.Person + - Me.Person.Actions summary: Invoke action Hire description: Hires someone for the company. operationId: Me.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -8718,7 +8718,7 @@ paths: description: Provides operations to call the ShareTrip method. post: tags: - - Me.Person + - Me.Person.Actions summary: Invoke action ShareTrip description: Details of the shared trip. operationId: Me.ShareTrip @@ -8740,7 +8740,7 @@ paths: description: Provides operations to call the UpdatePersonLastName method. get: tags: - - Me.Person + - Me.Person.Functions summary: Invoke function UpdatePersonLastName operationId: Me.UpdatePersonLastName parameters: @@ -11598,7 +11598,7 @@ paths: description: Provides operations to call the GetFavoriteAirline method. get: tags: - - NewComePeople.Person + - NewComePeople.Person.Functions summary: Invoke function GetFavoriteAirline operationId: NewComePeople.Person.GetFavoriteAirline parameters: @@ -11619,7 +11619,7 @@ paths: description: Provides operations to call the GetFriendsTrips method. get: tags: - - NewComePeople.Person + - NewComePeople.Person.Functions summary: Invoke function GetFriendsTrips operationId: NewComePeople.Person.GetFriendsTrips parameters: @@ -11687,7 +11687,7 @@ paths: description: Provides operations to call the GetPeersForTrip method. post: tags: - - NewComePeople.Person + - NewComePeople.Person.Actions summary: Invoke action GetPeersForTrip operationId: NewComePeople.Person.GetPeersForTrip parameters: @@ -11710,7 +11710,7 @@ paths: description: Provides operations to call the Hire method. post: tags: - - NewComePeople.Person + - NewComePeople.Person.Actions summary: Invoke action Hire description: Hires someone for the company. operationId: NewComePeople.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -11745,7 +11745,7 @@ paths: description: Provides operations to call the ShareTrip method. post: tags: - - NewComePeople.Person + - NewComePeople.Person.Actions summary: Invoke action ShareTrip description: Details of the shared trip. operationId: NewComePeople.Person.ShareTrip @@ -11769,7 +11769,7 @@ paths: description: Provides operations to call the UpdatePersonLastName method. get: tags: - - NewComePeople.Person + - NewComePeople.Person.Functions summary: Invoke function UpdatePersonLastName operationId: NewComePeople.Person.UpdatePersonLastName parameters: @@ -18357,7 +18357,7 @@ paths: description: Provides operations to call the GetFavoriteAirline method. get: tags: - - People.Person + - People.Person.Functions summary: Invoke function GetFavoriteAirline operationId: People.Person.GetFavoriteAirline parameters: @@ -18384,7 +18384,7 @@ paths: description: Provides operations to call the GetFriendsTrips method. get: tags: - - People.Person + - People.Person.Functions summary: Invoke function GetFriendsTrips operationId: People.Person.GetFriendsTrips parameters: @@ -18452,7 +18452,7 @@ paths: description: Provides operations to call the GetPeersForTrip method. post: tags: - - People.Person + - People.Person.Actions summary: Invoke action GetPeersForTrip operationId: People.Person.GetPeersForTrip parameters: @@ -21251,7 +21251,7 @@ paths: description: Provides operations to call the Hire method. post: tags: - - People.Person + - People.Person.Actions summary: Invoke action Hire description: Hires someone for the company. operationId: People.Person.Microsoft.OData.Service.Sample.TrippinInMemory.Models.Manager.Hire @@ -21990,7 +21990,7 @@ paths: description: Provides operations to call the ShareTrip method. post: tags: - - People.Person + - People.Person.Actions summary: Invoke action ShareTrip description: Details of the shared trip. operationId: People.Person.ShareTrip @@ -22020,7 +22020,7 @@ paths: description: Provides operations to call the UpdatePersonLastName method. get: tags: - - People.Person + - People.Person.Functions summary: Invoke function UpdatePersonLastName operationId: People.Person.UpdatePersonLastName parameters: @@ -24080,12 +24080,20 @@ tags: x-ms-docs-toc-type: page - name: Me.Trips.PlanItem x-ms-docs-toc-type: page + - name: Me.Person.Functions + x-ms-docs-toc-type: container + - name: Me.Person.Actions + x-ms-docs-toc-type: container - name: NewComePeople.Person x-ms-docs-toc-type: page - name: NewComePeople.Location x-ms-docs-toc-type: page - name: NewComePeople.Person.Location x-ms-docs-toc-type: page + - name: NewComePeople.Person.Functions + x-ms-docs-toc-type: container + - name: NewComePeople.Person.Actions + x-ms-docs-toc-type: container - name: NewComePeople.Trip x-ms-docs-toc-type: page - name: NewComePeople.Trips.PlanItem @@ -24100,5 +24108,9 @@ tags: x-ms-docs-toc-type: page - name: People.Trips.PlanItem x-ms-docs-toc-type: page + - name: People.Person.Functions + x-ms-docs-toc-type: container + - name: People.Person.Actions + x-ms-docs-toc-type: container - name: ResetDataSource x-ms-docs-toc-type: container \ No newline at end of file From 72e0a33182a54c370779c5f7e32cb57587838f3f Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 22 Jan 2025 12:06:45 +0300 Subject: [PATCH 39/52] Fix regression in unique openId generation. --- .../Microsoft.OpenAPI.OData.Reader.csproj | 4 +-- .../Operation/EdmOperationOperationHandler.cs | 35 +++++++++++-------- .../EdmFunctionOperationHandlerTests.cs | 8 ++--- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index d8b324206..7ab181e85 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,13 +15,13 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.7.2 + 1.7.3 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - - Adds action/function suffix to tag names for actions/functions operations in #642 + - Fix regression in unique operation id generation at #462. Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk diff --git a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs index a9b5ebacd..5fe1a5903 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Operation/EdmOperationOperationHandler.cs @@ -81,6 +81,7 @@ protected override void SetBasicInfo(OpenApiOperation operation) // duplicates in entity vs entityset functions/actions List identifiers = new(); + string pathHash = string.Empty; foreach (ODataSegment segment in Path.Segments) { if (segment is ODataKeySegment keySegment) @@ -101,6 +102,18 @@ protected override void SetBasicInfo(OpenApiOperation operation) identifiers.Add(keySegment.Identifier); } } + else if (segment is ODataOperationSegment opSegment) + { + if (opSegment.Operation is IEdmFunction function && Context.Model.IsOperationOverload(function)) + { + // Hash the segment to avoid duplicate operationIds + pathHash = string.IsNullOrEmpty(pathHash) + ? opSegment.GetPathHash(Context.Settings) + : (pathHash + opSegment.GetPathHash(Context.Settings)).GetHashSHA256().Substring(0, 4); + } + + identifiers.Add(segment.Identifier); + } else { identifiers.Add(segment.Identifier); @@ -109,21 +122,13 @@ protected override void SetBasicInfo(OpenApiOperation operation) string operationId = string.Join(".", identifiers); - if (EdmOperation.IsAction()) - { - operation.OperationId = operationId; - } - else - { - if (Path.LastSegment is ODataOperationSegment operationSegment && - Context.Model.IsOperationOverload(operationSegment.Operation)) - { - operation.OperationId = operationId + "-" + Path.LastSegment.GetPathHash(Context.Settings); - } - else - { - operation.OperationId = operationId; - } + if (!string.IsNullOrEmpty(pathHash)) + { + operation.OperationId = operationId + "-" + pathHash; + } + else + { + operation.OperationId = operationId; } } diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index dd0fa6bac..0cfd23d75 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -378,10 +378,10 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati if (enableOperationId) { - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-6b6d", operation1.OperationId); - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-2636", operation2.OperationId); - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-6b6d", operation3.OperationId); - Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-2636", operation4.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-c53d", operation1.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-4d93", operation2.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-a2b2", operation3.OperationId); + Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-7bea", operation4.OperationId); } else { From 1aa82336d985dbb62f113d3e129ea410db28432f Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Wed, 22 Jan 2025 12:10:45 +0300 Subject: [PATCH 40/52] Add extra test --- .../Operation/EdmFunctionOperationHandlerTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs index 0cfd23d75..5fe3d7164 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/Operation/EdmFunctionOperationHandlerTests.cs @@ -3,6 +3,7 @@ // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------ +using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; @@ -382,6 +383,14 @@ public void CreateOperationForComposableOverloadEdmFunctionReturnsCorrectOperati Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-4d93", operation2.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-a2b2", operation3.OperationId); Assert.Equal("Customers.Customer.MyFunction1.MyFunction2-7bea", operation4.OperationId); + var operationIds = new HashSet(StringComparer.OrdinalIgnoreCase) + { + operation1.OperationId, + operation2.OperationId, + operation3.OperationId, + operation4.OperationId + }; + Assert.Equal(4, operationIds.Count);// All are unique as the hashset size is unchanged! } else { From 05b15f46dbd831ee3ae46e0f312c6d2f6a72c28d Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 10:22:45 +0300 Subject: [PATCH 41/52] Adds support for retrieving collection of enum values from `UpdateMethod` property of `UpdateRestrictions` annotation (#567) * Add method for retrieving collection of enum values * Update the UpdateMethod to an IList * Add support for generating both PUT and PATCH operations * Update unit tests to validate support for both PUT and PATCH * Update release note * Small typo fix * Another very small typo fix * Update function to account for flagged enums * Use flags attribute on enum type; revert property name --- .../Edm/RecordExpressionExtensions.cs | 24 ++++++++++++---- .../PathItem/ComplexPropertyItemHandler.cs | 7 ++++- .../PathItem/EntityPathItemHandler.cs | 7 ++++- .../NavigationPropertyPathItemHandler.cs | 28 +++++++++++-------- .../Capabilities/UpdateRestrictionsType.cs | 22 ++++++++++----- .../NavigationPropertyPathItemHandlerTests.cs | 14 +++++----- 6 files changed, 69 insertions(+), 33 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/RecordExpressionExtensions.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/RecordExpressionExtensions.cs index 01cf7aeab..5d8dc6d4a 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Edm/RecordExpressionExtensions.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Edm/RecordExpressionExtensions.cs @@ -94,18 +94,30 @@ public static string GetString(this IEdmRecordExpression record, string property /// The property name. /// The Enum value or null. public static T? GetEnum(this IEdmRecordExpression record, string propertyName) - where T : struct + where T : struct, Enum { Utils.CheckArgumentNull(record, nameof(record)); Utils.CheckArgumentNull(propertyName, nameof(propertyName)); - return (record.Properties?.FirstOrDefault(e => propertyName.Equals(e.Name, StringComparison.Ordinal)) is IEdmPropertyConstructor property && + if (record.Properties?.FirstOrDefault(e => propertyName.Equals(e.Name, StringComparison.Ordinal)) + is IEdmPropertyConstructor property && property.Value is IEdmEnumMemberExpression value && value.EnumMembers != null && - value.EnumMembers.Any() && - Enum.TryParse(value.EnumMembers.First().Name, out T result)) ? - result : - null; + value.EnumMembers.Any()) + { + long combinedValue = 0; + foreach (var enumMember in value.EnumMembers) + { + if (Enum.TryParse(enumMember.Name, out T enumValue)) + { + combinedValue |= Convert.ToInt64(enumValue); + } + } + + return (T)Enum.ToObject(typeof(T), combinedValue); + } + + return null; } /// diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs index 866dcef3d..b08a22892 100644 --- a/src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs @@ -70,7 +70,12 @@ public void AddUpdateOperation(OpenApiPathItem item) if ((Context.Settings.RequireRestrictionAnnotationsToGenerateComplexPropertyPaths && isUpdatable) || !Context.Settings.RequireRestrictionAnnotationsToGenerateComplexPropertyPaths) { - if (updateRestrictions != null && updateRestrictions.IsUpdateMethodPut) + if (updateRestrictions?.IsUpdateMethodPutAndPatch == true) + { + AddOperation(item, OperationType.Put); + AddOperation(item, OperationType.Patch); + } + else if (updateRestrictions?.IsUpdateMethodPut == true) { AddOperation(item, OperationType.Put); } diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/EntityPathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/EntityPathItemHandler.cs index 7c66d7d9c..d7f688ae4 100644 --- a/src/Microsoft.OpenApi.OData.Reader/PathItem/EntityPathItemHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/EntityPathItemHandler.cs @@ -40,7 +40,12 @@ protected override void SetOperations(OpenApiPathItem item) updateRestrictions ??= entityUpdateRestrictions; if (updateRestrictions?.IsUpdatable ?? true) { - if (updateRestrictions != null && updateRestrictions.IsUpdateMethodPut) + if (updateRestrictions?.IsUpdateMethodPutAndPatch == true) + { + AddOperation(item, OperationType.Put); + AddOperation(item, OperationType.Patch); + } + else if (updateRestrictions?.IsUpdateMethodPut == true) { AddOperation(item, OperationType.Put); } diff --git a/src/Microsoft.OpenApi.OData.Reader/PathItem/NavigationPropertyPathItemHandler.cs b/src/Microsoft.OpenApi.OData.Reader/PathItem/NavigationPropertyPathItemHandler.cs index 57b361197..e66675f75 100644 --- a/src/Microsoft.OpenApi.OData.Reader/PathItem/NavigationPropertyPathItemHandler.cs +++ b/src/Microsoft.OpenApi.OData.Reader/PathItem/NavigationPropertyPathItemHandler.cs @@ -243,17 +243,23 @@ private void AddDeleteOperation(OpenApiPathItem item, NavigationPropertyRestrict private void AddUpdateOperation(OpenApiPathItem item, UpdateRestrictionsType updateRestrictionsType) { - if (updateRestrictionsType == null || updateRestrictionsType.IsUpdatable) - { - if (updateRestrictionsType != null && updateRestrictionsType.IsUpdateMethodPut) - { - AddOperation(item, OperationType.Put); - } - else - { - AddOperation(item, OperationType.Patch); - } - } + if (updateRestrictionsType?.IsUpdatable ?? true) + { + if (updateRestrictionsType?.IsUpdateMethodPutAndPatch == true) + { + AddOperation(item, OperationType.Put); + AddOperation(item, OperationType.Patch); + } + else if (updateRestrictionsType?.IsUpdateMethodPut == true) + { + AddOperation(item, OperationType.Put); + } + else + { + AddOperation(item, OperationType.Patch); + } + } + } /// diff --git a/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/UpdateRestrictionsType.cs b/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/UpdateRestrictionsType.cs index 27e3e8f59..ff073e399 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/UpdateRestrictionsType.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Vocabulary/Capabilities/UpdateRestrictionsType.cs @@ -3,6 +3,7 @@ // Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. // ------------------------------------------------------------ +using System; using System.Collections.Generic; using System.Linq; using Microsoft.OData.Edm.Vocabularies; @@ -14,17 +15,18 @@ namespace Microsoft.OpenApi.OData.Vocabulary.Capabilities /// /// Enumerates HTTP methods that can be used to update entities /// + [Flags] internal enum HttpMethod { /// /// The HTTP PATCH Method /// - PATCH, + PATCH = 1, /// /// The HTTP PUT Method /// - PUT + PUT = 2 } /// /// Complex Type: Org.OData.Capabilities.V1.UpdateRestrictionsType @@ -46,10 +48,10 @@ internal class UpdateRestrictionsType : IRecord /// /// Gets the value indicating Entities can be inserted, updated, and deleted via a PATCH request with a delta payload. /// - public bool? DeltaUpdateSupported { get; private set; } - + public bool? DeltaUpdateSupported { get; private set; } + /// - /// Gets the value indicating the HTTP Method (PUT or PATCH) for updating an entity. + /// Gets the values indicating the HTTP Method (PUT and/or PATCH) for updating an entity. /// If null, PATCH should be supported and PUT MAY be supported. /// public HttpMethod? UpdateMethod { get; private set; } @@ -124,10 +126,16 @@ public bool IsNonUpdatableNavigationProperty(string navigationPropertyPath) } /// - /// Tests whether the update method for the entity has been explicitly specified as PUT + /// Tests whether the update method for the target has been explicitly specified as PUT /// public bool IsUpdateMethodPut => UpdateMethod.HasValue && UpdateMethod.Value == HttpMethod.PUT; + /// + /// Tests whether the update method for the target has been explicitly specified as PATCH and PUT + /// + public bool IsUpdateMethodPutAndPatch => UpdateMethod.HasValue && + (UpdateMethod.Value & (HttpMethod.PUT | HttpMethod.PATCH)) == (HttpMethod.PUT | HttpMethod.PATCH); + /// /// Lists the media types acceptable for the request content /// @@ -157,7 +165,7 @@ public void Initialize(IEdmRecordExpression record) // DeltaUpdateSupported DeltaUpdateSupported = record.GetBoolean("DeltaUpdateSupported"); - // UpdateMethod + // UpdateMethod UpdateMethod = record.GetEnum("UpdateMethod"); // FilterSegmentSupported diff --git a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/NavigationPropertyPathItemHandlerTests.cs b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/NavigationPropertyPathItemHandlerTests.cs index 66aedac9f..61f383455 100644 --- a/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/NavigationPropertyPathItemHandlerTests.cs +++ b/test/Microsoft.OpenAPI.OData.Reader.Tests/PathItem/NavigationPropertyPathItemHandlerTests.cs @@ -452,7 +452,7 @@ public void CreatePathItemForNavigationPropertyAndUpdateMethodUpdateRestrictions - Org.OData.Capabilities.V1.HttpMethod/PUT + Org.OData.Capabilities.V1.HttpMethod/PUT Org.OData.Capabilities.V1.HttpMethod/PATCH @@ -488,21 +488,21 @@ public void CreatePathItemForNavigationPropertyAndUpdateMethodUpdateRestrictions if (isContainment) { expected = updatable - ? (new[] { OperationType.Get, OperationType.Put, OperationType.Delete }) - : (new[] { OperationType.Get, OperationType.Delete }); + ? ([OperationType.Get, OperationType.Put, OperationType.Patch, OperationType.Delete]) + : ([OperationType.Get, OperationType.Delete]); } else { expected = updatable - ? (new[] { OperationType.Get, OperationType.Put }) - : (new[] { OperationType.Get }); + ? ([OperationType.Get, OperationType.Put, OperationType.Patch,]) + : ([OperationType.Get]); } } else { expected = isContainment - ? (new[] { OperationType.Get, OperationType.Patch, OperationType.Delete }) - : (new[] { OperationType.Get }); + ? ([OperationType.Get, OperationType.Patch, OperationType.Delete]) + : ([OperationType.Get]); } From f69fea0e056e6de5a76b128e31ab580ec13356fa Mon Sep 17 00:00:00 2001 From: Andrew Omondi Date: Tue, 28 Jan 2025 10:26:53 +0300 Subject: [PATCH 42/52] Sync 567 changes to v1 of the library --- .../Microsoft.OpenAPI.OData.Reader.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 7ab181e85..441a9d880 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -15,13 +15,13 @@ netstandard2.0 Microsoft.OpenApi.OData true - 1.7.3 + 1.7.4 This package contains the codes you need to convert OData CSDL to Open API Document of Model. © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM https://github.com/Microsoft/OpenAPI.NET.OData - - Fix regression in unique operation id generation at #462. + - Sync changes from https://github.com/microsoft/OpenAPI.NET.OData/pull/567 to V1 of the library Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk From 2906e77f8a196ddfcfdda22ec37fa250356907f1 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 12:45:48 -0500 Subject: [PATCH 43/52] ci: adds release please configuration Signed-off-by: Vincent Biret ci: adds missing manifest Signed-off-by: Vincent Biret ci: fixes version read for releases Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 23 ++++----- .github/release-please.yml | 7 +++ .release-please-manifest.json | 3 ++ CHANGELOG.md | 1 + CONTRIBUTING.md | 50 +++++++++++++++++++ Directory.Build.props | 25 ++++++++++ release-please-config.json | 33 ++++++++++++ .../Microsoft.OpenAPI.OData.Reader.csproj | 14 ------ 8 files changed, 128 insertions(+), 28 deletions(-) create mode 100644 .github/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 Directory.Build.props create mode 100644 release-please-config.json diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index ee410f158..3b590ba85 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -8,6 +8,9 @@ trigger: include: - main - support/v1 + tags: + include: + - 'v*' pr: branches: include: @@ -147,7 +150,7 @@ extends: - task: PowerShell@2 displayName: 'Validate project version has been incremented' - condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded()) + condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) inputs: targetType: 'filePath' filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 @@ -188,7 +191,7 @@ extends: PendingAnalysisWaitTimeoutMinutes: '5' - stage: deploy - condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded()) + condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) dependsOn: build jobs: - deployment: deploy @@ -232,7 +235,7 @@ extends: steps: - pwsh: | $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1 - $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData", "" -replace ".nupkg", "" + $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData.", "" -replace ".nupkg", "" #Set Variable $artifactName and $artifactVersion Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion" echo "$artifactVersion" @@ -242,18 +245,10 @@ extends: condition: succeededOrFailed() inputs: gitHubConnection: 'Github-MaggieKimani1' - action: create + action: edit tagSource: userSpecifiedTag tag: 'v$(artifactVersion)' title: 'v$(artifactVersion)' releaseNotesSource: inline - assets: '$(Pipeline.Workspace)\**\*.nupkg' - changeLogType: issueBased - changeLogLabels: '[ - { "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" }, - { "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" }, - { "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" }, - { "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"}, - { "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" } - ]' - + assets: '$(Pipeline.Workspace)\**\*.nupkg' + addChangeLog: false diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 000000000..c821fc166 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,7 @@ +manifest: true +primaryBranch: main +handleGHRelease: true +branches: + - branch: support/v1 + manifest: true + handleGHRelease: true \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..da56a96bd --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.0.0-preview7" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..825c32f0d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..02d4e00a1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,50 @@ +# Contributing to OpenAPI.net.OData + +OpenAPI.net.OData is a mono-repo containing source code for the following packages: + +## Libraries + +| Library | NuGet Release | +|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Microsoft.OpenAPI.OData](./README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.OData?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI/) | + +OpenAPI.net.OData is open to contributions. There are a couple of different recommended paths to get contributions into the released version of this library. + +__NOTE__ A signed a contribution license agreement is required for all contributions, and is checked automatically on new pull requests. Please read and sign [the agreement](https://cla.microsoft.com/) before starting any work for this repository. + +## File issues + +The best way to get started with a contribution is to start a dialog with the owners of this repository. Sometimes features will be under development or out of scope for this SDK and it's best to check before starting work on contribution. Discussions on bugs and potential fixes could point you to the write change to make. + +## Submit pull requests for bug fixes and features + +Feel free to submit a pull request with a linked issue against the __main__ branch. The main branch will be updated frequently. +## Commit message format + +To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) +format. +Each commit message consists of a __header__, an optional __body__ and an optional __footer__. The header is the first line of the commit and +MUST have a __type__ (see below for a list of types) and a __description__. An optional __scope__ can be added to the header to give extra context. + +``` +[optional scope]: + + + + +``` + +The recommended commit types used are: + +- __feat__ for feature updates (increments the _minor_ version) +- __fix__ for bug fixes (increments the _patch_ version) +- __perf__ for performance related changes e.g. optimizing an algorithm +- __refactor__ for code refactoring changes +- __test__ for test suite updates e.g. adding a test or fixing a test +- __style__ for changes that don't affect the meaning of code. e.g. formatting changes +- __docs__ for documentation updates e.g. ReadMe update or code documentation updates +- __build__ for build system changes (gradle updates, external dependency updates) +- __ci__ for CI configuration file changes e.g. updating a pipeline +- __chore__ for miscallaneous non-sdk changesin the repo e.g. removing an unused file + +Adding an exclamation mark after the commit type (`feat!`) or footer with the prefix __BREAKING CHANGE:__ will cause an increment of the _major_ version. \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 000000000..189e02d2d --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,25 @@ + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + Microsoft + Microsoft + MIT + true + https://github.com/Microsoft/OpenAPI.NET + https://github.com/Microsoft/OpenAPI.NET.OData + https://github.com/microsoft/OpenAPI.NET.OData/releases + true + http://go.microsoft.com/fwlink/?LinkID=288890 + https://github.com/Microsoft/OpenAPI.NET.OData + © Microsoft Corporation. All rights reserved. + Microsoft OpenApi OData EDM + 2.0.0-preview7 + + + + true + + + + + \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..b2a064008 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,33 @@ +{ + "bootstrap-sha": "4f9bad6ea7d25e8596c0ca214975e690d925e6e7", + "exclude-paths": [ + ".azure-pipelines", + ".github", + ".idea", + ".vs", + ".vscode" + ], + "release-type": "simple", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "include-component-in-tag": false, + "include-v-in-tag": true, + "draft": false, + "prerelease": true, + "versioning": "prerelease", + "prerelease-type": "preview", + "packages": { + ".": { + "package-name": "Microsoft.OpenApi.OData", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "xml", + "path": "Directory.Build.props", + "xpath": "//Project/PropertyGroup/Version" + } + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} \ No newline at end of file diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 441a9d880..fb4cde3b2 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -4,25 +4,12 @@ Microsoft.OpenApi.OData.Reader Latest true - icon.png - https://github.com/Microsoft/OpenAPI.NET.OData - MIT - true - Microsoft - Microsoft Microsoft Open API OData Reader Microsoft.OpenApi.OData netstandard2.0 Microsoft.OpenApi.OData true - 1.7.4 This package contains the codes you need to convert OData CSDL to Open API Document of Model. - © Microsoft Corporation. All rights reserved. - Microsoft OpenApi OData EDM - https://github.com/Microsoft/OpenAPI.NET.OData - - - Sync changes from https://github.com/microsoft/OpenAPI.NET.OData/pull/567 to V1 of the library - Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ @@ -51,7 +38,6 @@ - True True From 9fbc0607531c2caea0a2702f4fe3e64fa3d2c2bf Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:05:48 -0500 Subject: [PATCH 44/52] ci: updates configuration for support branch Signed-off-by: Vincent Biret --- .release-please-manifest.json | 2 +- Directory.Build.props | 2 +- release-please-config.json | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da56a96bd..0537754e6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0-preview7" + ".": "1.7.4" } \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 189e02d2d..41b1c0f4f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ https://github.com/Microsoft/OpenAPI.NET.OData © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM - 2.0.0-preview7 + 1.7.4 diff --git a/release-please-config.json b/release-please-config.json index b2a064008..96a364728 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,5 @@ { - "bootstrap-sha": "4f9bad6ea7d25e8596c0ca214975e690d925e6e7", + "bootstrap-sha": "f69fea0e056e6de5a76b128e31ab580ec13356fa", "exclude-paths": [ ".azure-pipelines", ".github", @@ -13,9 +13,6 @@ "include-component-in-tag": false, "include-v-in-tag": true, "draft": false, - "prerelease": true, - "versioning": "prerelease", - "prerelease-type": "preview", "packages": { ".": { "package-name": "Microsoft.OpenApi.OData", From 98dd06576dc8131a6bdb134c63c857df13df11a2 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:09:20 -0500 Subject: [PATCH 45/52] ci: removes duplicated package reference Signed-off-by: Vincent Biret --- .../Microsoft.OpenAPI.OData.Reader.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index fb4cde3b2..193a738bd 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -30,10 +30,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - From a1116b0085a7920c34d7d16785e1a3ad1d044ebb Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:16:41 -0500 Subject: [PATCH 46/52] ci: disables treat warnings as errors Signed-off-by: Vincent Biret --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 41b1c0f4f..1c0004b1a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ https://github.com/Microsoft/OpenAPI.NET https://github.com/Microsoft/OpenAPI.NET.OData https://github.com/microsoft/OpenAPI.NET.OData/releases - true + false http://go.microsoft.com/fwlink/?LinkID=288890 https://github.com/Microsoft/OpenAPI.NET.OData © Microsoft Corporation. All rights reserved. From f07f4caeb5969f47ccb2a901af24bebb36234e3c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:28:49 -0500 Subject: [PATCH 47/52] docs: fixes package link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 02d4e00a1..334509bee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ OpenAPI.net.OData is a mono-repo containing source code for the following packag | Library | NuGet Release | |----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Microsoft.OpenAPI.OData](./README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.OData?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI/) | +| [Microsoft.OpenAPI.OData](./README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.OData?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI.OData/) | OpenAPI.net.OData is open to contributions. There are a couple of different recommended paths to get contributions into the released version of this library. From c73c9c5e1e0c0835d656362bdf59bf59c4c114b5 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 11 Feb 2025 11:55:18 -0500 Subject: [PATCH 48/52] ci: fixes version check script --- scripts/ValidateProjectVersionUpdated.ps1 | 65 ++++++++++++++++++----- 1 file changed, 51 insertions(+), 14 deletions(-) diff --git a/scripts/ValidateProjectVersionUpdated.ps1 b/scripts/ValidateProjectVersionUpdated.ps1 index faa6800e1..5250e58f2 100644 --- a/scripts/ValidateProjectVersionUpdated.ps1 +++ b/scripts/ValidateProjectVersionUpdated.ps1 @@ -10,34 +10,71 @@ NuGet. If the version has not been updated, the script will fail and indicate that the project version neeeds to be updated. #> -Install-Module SemVerPS -Scope CurrentUser -Force $packageName = "Microsoft.OpenApi.OData" -$csprojPath = Join-Path $PSScriptRoot "..\src\Microsoft.OpenApi.OData.Reader\Microsoft.OpenAPI.OData.Reader.csproj" +$csprojPath = Join-Path $PSScriptRoot "..\Directory.Build.props" [XML]$csprojFile = Get-Content $csprojPath $versionNode = Select-Xml $csprojFile -XPath "//Project/PropertyGroup/Version" | Select-Object -ExpandProperty Node $projectVersion = $versionNode.InnerText +# If is missing, try + +if ($null -eq $projectVersion) +{ + $versionPrefixNode = Select-Xml $csprojFile -XPath "//Project/PropertyGroup/VersionPrefix" | Select-Object -ExpandProperty Node + $versionSuffixNode = Select-Xml $csprojFile -XPath "//Project/PropertyGroup/VersionSuffix" | Select-Object -ExpandProperty Node + $projectVersion = $versionPrefixNode.InnerText + $versionSuffixNode.InnerText +} + +# Ensure a valid version exists +if (-not $projectVersion -or $projectVersion -eq "") { + Write-Error "No valid version found in .csproj file. Please define or for $packageName." + Exit 1 +} + # Cast the project version string to System.Version -$currentProjectVersion = ConvertTo-SemVer -Version $projectVersion +$currentProjectVersion = [System.Management.Automation.SemanticVersion]$projectVersion +$currentMajorVersion = $currentProjectVersion.Major # API is case-sensitive $packageName = $packageName.ToLower() $url = "https://api.nuget.org/v3/registration5-gz-semver2/$packageName/index.json" # Call the NuGet API for the package and get the current published version. -$nugetIndex = Invoke-RestMethod -Uri $url -Method Get -$publishedVersionString = $nugetIndex.items[0].upper +Try { + $nugetIndex = Invoke-RestMethod -Uri $url -Method Get -ErrorAction Stop +} Catch { + if ($_.Exception.Response.StatusCode -eq 404) { + Write-Host "No package exists. You will probably be publishing $packageName for the first time." + Exit 0 + } + Write-Error "Error fetching package details: $_" + Exit 1 +} -# Cast the published version string to System.Version -$currentPublishedVersion = ConvertTo-SemVer -Version $publishedVersionString +# Extract and sort all published versions (handling null/empty cases) +$publishedVersions = $nugetIndex.items | ForEach-Object { [System.Management.Automation.SemanticVersion]$_.upper } | Sort-Object -Descending -# Validate that the version number has been updated. -if ($currentProjectVersion -le $currentPublishedVersion) { - Write-Error "The project version in versioning.props file ($projectVersion) ` - has not been bumped up. The current published version is $publishedVersionString. ` - Please increment the current project version." +if (-not $publishedVersions -or $publishedVersions.Count -eq 0) { + Write-Host "No previous versions found on NuGet. Proceeding with publish." -ForegroundColor Green + Exit 0 } -else { - Write-Host "Validated that the version has been updated from $publishedVersionString to $currentProjectVersion" -ForegroundColor Green + +# Find the highest published version within the same major version +$highestPublishedVersionInMajor = ($publishedVersions | Where-Object { $_.Major -eq $currentMajorVersion }) + +# Handle empty or null major versions list +if (-not $highestPublishedVersionInMajor -or $highestPublishedVersionInMajor.Count -eq 0) { + Write-Host "No previous versions found for major version $currentMajorVersion. Proceeding with publish." -ForegroundColor Green + Exit 0 } + +# Get the latest version for the current major version +$latestMajorVersion = $highestPublishedVersionInMajor[0] + +# Validate that the version number has increased +if ($currentProjectVersion -le $latestMajorVersion) { + Write-Error "The version in .csproj ($currentProjectVersion) must be greater than the highest published version in the same major ($latestMajorVersion)." + Exit 1 +} else { + Write-Host "Validated version update: $latestMajorVersion -> $currentProjectVersion" -ForegroundColor Green +} \ No newline at end of file From 20d54d8f025da12fc242ac63221c02f4328dd7a6 Mon Sep 17 00:00:00 2001 From: Maggie Kimani Date: Tue, 18 Mar 2025 19:32:58 +0300 Subject: [PATCH 49/52] ci: remove redundant version validation script and step (#670) --- .azure-pipelines/ci-build.yml | 8 --- scripts/ValidateProjectVersionUpdated.ps1 | 80 ----------------------- 2 files changed, 88 deletions(-) delete mode 100644 scripts/ValidateProjectVersionUpdated.ps1 diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 3b590ba85..cedb47a0a 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -148,14 +148,6 @@ extends: projects: src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj arguments: '-o $(Build.ArtifactStagingDirectory) --configuration $(BuildConfiguration) --no-build --include-symbols --include-source /p:SymbolPackageFormat=snupkg' - - task: PowerShell@2 - displayName: 'Validate project version has been incremented' - condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) - inputs: - targetType: 'filePath' - filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 - pwsh: true - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5 displayName: 'ESRP CodeSigning Nuget Packages' inputs: diff --git a/scripts/ValidateProjectVersionUpdated.ps1 b/scripts/ValidateProjectVersionUpdated.ps1 deleted file mode 100644 index 5250e58f2..000000000 --- a/scripts/ValidateProjectVersionUpdated.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -<# -.Synopsis - Validates that the package version has been updated -.Description - Validates that the package version has been updated by comparing the version - specified in the project file with the latest package version published on - NuGet. If the version has not been updated, the script will fail and indicate - that the project version neeeds to be updated. -#> -$packageName = "Microsoft.OpenApi.OData" -$csprojPath = Join-Path $PSScriptRoot "..\Directory.Build.props" - -[XML]$csprojFile = Get-Content $csprojPath -$versionNode = Select-Xml $csprojFile -XPath "//Project/PropertyGroup/Version" | Select-Object -ExpandProperty Node -$projectVersion = $versionNode.InnerText - -# If is missing, try + -if ($null -eq $projectVersion) -{ - $versionPrefixNode = Select-Xml $csprojFile -XPath "//Project/PropertyGroup/VersionPrefix" | Select-Object -ExpandProperty Node - $versionSuffixNode = Select-Xml $csprojFile -XPath "//Project/PropertyGroup/VersionSuffix" | Select-Object -ExpandProperty Node - $projectVersion = $versionPrefixNode.InnerText + $versionSuffixNode.InnerText -} - -# Ensure a valid version exists -if (-not $projectVersion -or $projectVersion -eq "") { - Write-Error "No valid version found in .csproj file. Please define or for $packageName." - Exit 1 -} - -# Cast the project version string to System.Version -$currentProjectVersion = [System.Management.Automation.SemanticVersion]$projectVersion -$currentMajorVersion = $currentProjectVersion.Major - -# API is case-sensitive -$packageName = $packageName.ToLower() -$url = "https://api.nuget.org/v3/registration5-gz-semver2/$packageName/index.json" - -# Call the NuGet API for the package and get the current published version. -Try { - $nugetIndex = Invoke-RestMethod -Uri $url -Method Get -ErrorAction Stop -} Catch { - if ($_.Exception.Response.StatusCode -eq 404) { - Write-Host "No package exists. You will probably be publishing $packageName for the first time." - Exit 0 - } - Write-Error "Error fetching package details: $_" - Exit 1 -} - -# Extract and sort all published versions (handling null/empty cases) -$publishedVersions = $nugetIndex.items | ForEach-Object { [System.Management.Automation.SemanticVersion]$_.upper } | Sort-Object -Descending - -if (-not $publishedVersions -or $publishedVersions.Count -eq 0) { - Write-Host "No previous versions found on NuGet. Proceeding with publish." -ForegroundColor Green - Exit 0 -} - -# Find the highest published version within the same major version -$highestPublishedVersionInMajor = ($publishedVersions | Where-Object { $_.Major -eq $currentMajorVersion }) - -# Handle empty or null major versions list -if (-not $highestPublishedVersionInMajor -or $highestPublishedVersionInMajor.Count -eq 0) { - Write-Host "No previous versions found for major version $currentMajorVersion. Proceeding with publish." -ForegroundColor Green - Exit 0 -} - -# Get the latest version for the current major version -$latestMajorVersion = $highestPublishedVersionInMajor[0] - -# Validate that the version number has increased -if ($currentProjectVersion -le $latestMajorVersion) { - Write-Error "The version in .csproj ($currentProjectVersion) must be greater than the highest published version in the same major ($latestMajorVersion)." - Exit 1 -} else { - Write-Host "Validated version update: $latestMajorVersion -> $currentProjectVersion" -ForegroundColor Green -} \ No newline at end of file From 7cd11b4a59d3ca102e15f0596b39cd0934f63076 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 31 Mar 2025 14:00:19 -0400 Subject: [PATCH 50/52] fix: filter out not found alternate keys properties --- src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs index 0c5a17fbd..1c12bef69 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs +++ b/src/Microsoft.OpenApi.OData.Reader/Edm/ODataPathProvider.cs @@ -705,8 +705,9 @@ private void CreateAlternateKeyPath(ODataPath currentPath, IEdmEntityType entity IEnumerable> alternateKeys = _model.GetAlternateKeysAnnotation(entityType); foreach (var keyDict in alternateKeys) { + if (keyDict.Where(static x => x.Value is not null).ToDictionary(static k => k.Key, static v => v.Value.Name) is not { Count: > 0 } keyMappings) + continue; ODataPath keyPath = currentPath.Clone(); - IDictionary keyMappings = keyDict.ToDictionary(static k => k.Key, static v => v.Value.Name); ODataKeySegment keySegment = new(entityType, keyMappings) { IsAlternateKey = true From eb46cc705e0f5477c878c6be228810f511ceb187 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 18:17:55 +0000 Subject: [PATCH 51/52] chore(support/v1): release 1.7.5 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ Directory.Build.props | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0537754e6..557478b85 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.7.4" + ".": "1.7.5" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 825c32f0d..88e27e4b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,11 @@ # Changelog + +## [1.7.5](https://github.com/microsoft/OpenAPI.NET.OData/compare/v1.7.4...v1.7.5) (2025-03-31) + + +### Bug Fixes + +* filter out not found alternate keys properties ([d72bd6c](https://github.com/microsoft/OpenAPI.NET.OData/commit/d72bd6ce968f5bac7d2e698c58c95e1aa8ffdb74)) +* filter out not found alternate keys properties ([7cd11b4](https://github.com/microsoft/OpenAPI.NET.OData/commit/7cd11b4a59d3ca102e15f0596b39cd0934f63076)) + +## Changelog diff --git a/Directory.Build.props b/Directory.Build.props index 1c0004b1a..76f394de7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ https://github.com/Microsoft/OpenAPI.NET.OData © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM - 1.7.4 + 1.7.5 From 4be9df43bc1258539ec1bc9e56cb99f57e010edf Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 1 Apr 2025 15:29:25 -0400 Subject: [PATCH 52/52] security: aligns code owners with main branch --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 912000f61..af656d490 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @xuzhg @irvinesunday @darrelmiller @danielmbaluka @gavinbarron @millicentachieng @andrueastman @baywet +* @microsoft/openapi-write