Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1614

Add NonSelectableProperties to SelectSupportType

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: V4.01_OS
    • Fix Version/s: V4.02
    • Component/s: Vocabularies
    • Labels:
      None
    • Environment:

      [Proposed]

    • Proposal:
      Hide

      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>
      

      2. 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>
      
      Show
      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> 2. 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>

      Description

      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).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: