File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/JsonApiDotNetCore/Builders Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -92,9 +92,9 @@ protected virtual List<AttrAttribute> GetAttributes(Type entityType)
92
92
{
93
93
var attribute = ( AttrAttribute ) property . GetCustomAttribute ( typeof ( AttrAttribute ) ) ;
94
94
95
- // TODO: investigate why this is added in the exposed attributes list
96
- // because it is not really defined attribute considered from the json:api
97
- // spec point of view .
95
+ // Although strictly not correct, 'id' is added to the list of attributes for convenience.
96
+ // For example, it enables to filter on id, without the need to special-case existing logic.
97
+ // And when using sparse fields, it silently adds 'id' to the set of attributes to retrieve .
98
98
if ( property . Name == nameof ( Identifiable . Id ) && attribute == null )
99
99
{
100
100
var idAttr = new AttrAttribute
You can’t perform that action at this time.
0 commit comments