Properly handle type definitions elements in schema#103
Draft
habbes wants to merge 24 commits intoOData:masterfrom
Draft
Properly handle type definitions elements in schema#103habbes wants to merge 24 commits intoOData:masterfrom
habbes wants to merge 24 commits intoOData:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue #81
The connected service could not generate code for the Outlook Beta API mentioned in the related issue due to 2 main issue:
Issue 1
The outlook beta API mentioned in the related issue contained the following type definition:
Apparently the code generator did not know how to handle such cases. It tried to generate its code as an
IEdmEntityType, and that lead to null-reference exceptions. Similar issues occurred when translating function parameters that whose types are based on type definitions.This PR solves this issue in two ways:
E.g: a function defined in the schema as:
will be defined in the generated C# code as:
Note that using
MyNamespace.DateTimeas a type in the C# code would cause compile-time errors because there's no equivalent C# type generated for the type definition by the code generator.Issue 2
For edm types like
TimeOfDaywhich are defined in the OData Edm library, the connected service was generating code in the wrong namespace, i.e. generatingMicrosoft.OData.Edm.Library.TimeOfDayinstead ofMicrosoft.OData.Edm.TimeOfDay. It was probably generating code for an older version of the lib. The code generator itself uses an older version of edm lib (6.x). We should probably update it to 7.6 soon.PS:
I created this branch based on my other un-merged PR (pull #100) instead of the master branch because the master branch still does not have any tests suits. As soon as the other PR is merged, I'll remove the Draft status for this PR and mark it officially ready for review.