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

Add NonSelectableProperties to SelectSupportType #386

Open
ralfhandl opened this issue Mar 20, 2024 · 0 comments
Open

Add NonSelectableProperties to SelectSupportType #386

ralfhandl opened this issue Mar 20, 2024 · 0 comments
Assignees

Comments

@ralfhandl
Copy link
Contributor

There are times when properties can only be set when creating an entity or updating an entity, but cannot be retrieved. An example of this would be a password, which can be set through the API but not read.

We have capabilities for saying that a property can not be specified on creation (InsertRestrictions.NonInsertableProperties) or can not be specified on update (UpdateRestrictions.NonUpdatableProperties), and we have SelectSupportType for describing select capabilities, but we don't have any way to say a particular property cannot be read (there is no NonSelectableProperties).

Proposal

1a. Add NonSelectableProperties to SelectSupportType in the capabilities spec:

<Property Name="NonSelectableProperties" Type="Collection(Edm.PropertyPath)" Nullable="false">
     <Annotation Term="Core.Description" String="These structural properties cannot be specified in a select statement." />
 </Property>

1b. Alternatively, if we believe that read/write is a fundamental characteristic of the property, rather than a capability of the service, we could add a model annotation to the core vocabulary for specifying the readability/writeability of a property:

<Term Name="PropertyUsage" Type="Core.PropertyUsageType" DefaultValue="Create Read Update" Targets="property">
    <Annotation Term="Core.Description" String="Specifies whether the target property is intended for use in a create, read, or update operation." />
</Term>
<EnumType Name="PropertyUsageType" IsFlags="true">
   <Member Name="Create" Value=1>
      <Annotation Term="Core.Description" String="The annotated property can be used in a Create operation." />
   </Member>
   <Member Name="Read" Value=2>
      <Annotation Term="Core.Description" String="The annotated property can be read." />
   </Member>
   <Member Name="Update" Value=4>
      <Annotation Term="Core.Description" String="The annotated value can be updated." />
   </Member>
</EnumType>
  1. Add "Omitted" term to OData Core vocabulary used as an instance annotation to describe properties omitted from the payload:
<Term Name="Omitted" Type="Edm.String">
    <Annotation Term="Core.Description" String="The annotated property in a request or response payload was omitted for the specified reason." />
</Term>

Imported from ODATA-1614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants