Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes generation of ODataTypeCast paths #212

Merged
merged 12 commits into from
May 9, 2022

Conversation

irvinesunday
Copy link
Contributor

Fixes #199

This PR:

  • Fixes how OData type cast paths from navigation properties are being generated. The entity type targeting the navigation property is used in the argument in the method CreateTypeCastPaths() instead of the entity type declaring the navigation property.
  • Updated tests and integration test file due to the above fix.
  • Added a new setting ExpandDerivedTypesNavigationProperties that can be used to evaluate whether or not to expand derived types navigation properties. When this setting is set to true, we end up generating over 219K paths for the beta version of Graph (with a maximum of 1 type cast segment allowed in a path). This is because we have deeply nested derived types in our metadata. This needs to be set to false when generating OpenAPI documents for Graph. Trying to limit the number of type cast segments in a path does not help much. As described above, limiting the number of type cast segments in a path to 1 leads to a path count of over 219K (using the Graph beta integration test file in the test project). All this while ensuring circular generation of type cast segments is avoided and only ensuring unique type cast segments in the path.
  • Refactored code in the Utils.cs class.

@irvinesunday irvinesunday requested a review from baywet April 20, 2022 10:35
@irvinesunday irvinesunday requested a review from xuzhg as a code owner April 20, 2022 10:35
@irvinesunday irvinesunday self-assigned this Apr 20, 2022
@xuzhg
Copy link
Contributor

xuzhg commented Apr 25, 2022

Others look good to me

baywet
baywet previously approved these changes May 2, 2022
@baywet baywet added this to the 1.0.10-release milestone May 2, 2022
@baywet baywet force-pushed the is/fix-ODataTypeCast-paths branch from e9d42ea to 7cb1058 Compare May 4, 2022 13:17
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.

ODataTypeCast paths are not being generated
3 participants