-
Notifications
You must be signed in to change notification settings - Fork 65
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
Conversation
…complex property paths
There was a problem hiding this 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.
src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OpenApi.OData.Reader/PathItem/ComplexPropertyItemHandler.cs
Outdated
Show resolved
Hide resolved
/// <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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UseRestrictionAnnotationsToGenerateComplexPropertyPaths
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 @@ | |||
// ------------------------------------------------------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why delete?
There was a problem hiding this comment.
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
There was a problem hiding this 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.
Fixes #176
This PR
UseRestrictionAnnotationsToGeneratePathsForComplexProperties
which defaults totrue
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 istrue
, generation will look for the specific CRUD restriction annotation to determine whether readability, or updatability or insertability is enabled (by setting their values totrue
). IfUseRestrictionAnnotationsToGeneratePathsForComplexProperties
isfalse
, paths for complex properties are generated by default without inspecting the CRUD restrictions annotations. This happens in theODataPathProvider.cs
class when generating paths and in theComplexPropertyItemHandler.cs
class when generating the path item operations.