Skip to content

Use CRUD restrictions annotations for the generation of complex properties' paths #180

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

Merged
merged 12 commits into from
Feb 22, 2022

Conversation

irvinesunday
Copy link
Contributor

Fixes #176

This PR

  • Introduces a new convert setting UseRestrictionAnnotationsToGeneratePathsForComplexProperties which defaults to true that will be used as a flag to determine whether or not to use CRUD restrictions annotations for the generation of paths for complex properties. When this is true, generation will look for the specific CRUD restriction annotation to determine whether readability, or updatability or insertability is enabled (by setting their values to true). If UseRestrictionAnnotationsToGeneratePathsForComplexProperties is false, paths for complex properties are generated by default without inspecting the CRUD restrictions annotations. This happens in the ODataPathProvider.cs class when generating paths and in the ComplexPropertyItemHandler.cs class when generating the path item operations.
  • Removes delete operation for complex properties and related tests.
  • Updates the relevant tests.
  • Updates the integration test files.

Copy link
Member

@baywet baywet left a comment

Choose a reason for hiding this comment

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

thanks for taking this on, a few minor comments.

@irvinesunday irvinesunday merged commit 2a7e87c into master Feb 22, 2022
@irvinesunday irvinesunday deleted the fix/is/complextype-crud-restrictions branch February 22, 2022 21:14
/// <summary>
/// Gets/Sets a value indicating whether or not to use restrictions annotations to generate paths for complex properties.
/// </summary>
public bool UseRestrictionAnnotationsToGeneratePathsForComplexProperties { get; set; } = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

UseRestrictionAnnotationsToGenerateComplexPropertyPaths

Copy link
Contributor

Choose a reason for hiding this comment

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

by default, it should be "false" right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree this is a better name: UseRestrictionAnnotationsToGenerateComplexPropertyPaths

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by default, it should be "false" right?

Please refer to the discussion in the issue: #176

@@ -1,90 +0,0 @@
// ------------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

why delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why delete?

Same as above, the reason has been mentioned in the issue: #176

Copy link
Contributor

@xuzhg xuzhg left a comment

Choose a reason for hiding this comment

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

Others look good to me.

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.

only add complextype property path items when CRUD restrictions are present
3 participants