Skip to content

only add complextype property path items when CRUD restrictions are present #176

Closed
@baywet

Description

@baywet

#158 added additional paths for the structured properties (complex types) and their navigation properties. This resulted in an important growth of the number of path items being generated because this is enabled by default, and it doesn't read any annotation.

We should change the behavior to add the path items for complex properties only if readrestrictions/updaterestrictions (single properties or collections), create restrictions (collections) are present. The subsequent navigation properties paths for the complex type are only added when the parent structured/complex property is inserted.

We're not considering delete restrictions -> One can achieve the same thing by updating to null, and can't address single items for collections, guidance is to use entities at this point so it shouldn't be present.

We should also add a new convert setting "require CRUD restrictions to add structured properties path items", default true, so people can have the path items injected without having to add the annotations should they want to (when they set the setting to false).

code pointers

foreach (IEdmStructuralProperty sp in entityType.StructuralProperties()

TODO:

  • remove delete operations code for complex properties.
  • new convert setting "require CRUD restrictions to add structured properties path items", default true.
  • Only insert GET operation for complex properties if the new setting is false or if a read restriction is present
  • Only insert PATCH operation for complex properties if the new setting is false or if a update restriction is present
  • Only insert POST operation for complex properties when the property is a collection if the new setting is false or if a create restriction is present
  • update trip service (CSDL and output) to contain test data
  • update unit tests

Metadata

Metadata

Assignees

Labels

priority:p1High priority but not blocking. Causes major but not critical loss of functionality SLA <=7daystype:bugA broken experience

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions