Skip to content

Improve metadata uri handling#311

Merged
Nthemba merged 7 commits intoOData:masterfrom
Nthemba:Improve_metadata_Uri_handling
Sep 27, 2022
Merged

Improve metadata uri handling#311
Nthemba merged 7 commits intoOData:masterfrom
Nthemba:Improve_metadata_Uri_handling

Conversation

@Nthemba
Copy link
Copy Markdown
Contributor

@Nthemba Nthemba commented Aug 19, 2022

Fix for issue #48

This PR fixes the issue #48
and is an add on to a contributor's (https://github.com/dr-consit) PR #237

It ensures the OData Endpoint URI does not get distorted when the URI includes query and fragment segments.

Before fix
A URI like 'http://localhost:5000/odata/$metadata?api-version=1.0' would have $metadata appended to the end of the URI which would make the OData service inaccessible.

After fix
$metadata, query and fragment segments maintain the correct position and order.

Fix for issue #272

There was a method for getting the metadata version but it was in the OData Connected Service project. While working on odata-cliI had created a method for getting the metadata version in the core project library. I have replaced the method that I had created in the core project with the method that was in the OData Connected Service project as it takes care of Custom HttpHeaders and Web Proxies.

It fixes this issue #272

Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs
Copy link
Copy Markdown
Contributor

@KenitoInc KenitoInc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor changes requested.

Comment thread src/Microsoft.OData.CodeGen/Templates/ODataT4CodeGenerator.cs
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
@Nthemba Nthemba force-pushed the Improve_metadata_Uri_handling branch from d0beb43 to d9229ca Compare September 9, 2022 07:05
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/ODataConnectedService.Shared/ViewModels/ConfigODataEndpointViewModel.cs Outdated
Nthemba and others added 2 commits September 16, 2022 09:14
Co-authored-by: John Gathogo <john.gathogo@gmail.com>
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
<PackageReference Include="Microsoft.OData.Edm">
<Version>7.6.3</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.2.32505.173" ExcludeAssets="runtime">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes in this file deliberate or inadvertent?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not deliberate. Let me investigate the source

Comment thread src/Microsoft.OData.CodeGen/Common/MetadataReader.cs Outdated
@Nthemba Nthemba merged commit 11df934 into OData:master Sep 27, 2022
@johnwc johnwc mentioned this pull request Jan 14, 2023
DavidRobinsonDk pushed a commit to Consit/ODataConnectedService that referenced this pull request Jan 24, 2023
* Improve handling of URIs

Co-authored-by: June Ngei <junengei@microsoft.com>
Co-authored-by: John Gathogo <john.gathogo@gmail.com>
@jonaskaltenbachz
Copy link
Copy Markdown

Hello,
can you estimate when there will be a new odata-cli release for this improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants