Skip to content

Provide a means to deprecate/ignore a field without breaking requests. #157

@MrSwitch

Description

@MrSwitch

When removing fields, which do not have a fallback, we can convert them to a generated function, to return a value.

mydeprecatedfield() {
   return () => null;
}

However the above looks a little verbose. And it only applies when using api.get.

Proposal:

A better solution might be to handle an explicit definition which would tell the processor to ignore requests to this field.

mydeprecatedfield: null

This could be used to prevent the field being referenced in all .get, .patch, .post and .delete operations, whether using the field in a filter, join, modification or fields requests.

The fields attributes would convert a null value to {deprecated: true} possibly. Rather than the more aggressive {readable: false, writeable: false} which trigger exceptions.

This should also be considered in light of an alternative, where the schema field definition for a model are exclusive of all other fields. However that could equally be handled with a default field, i.e. default:false field property.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions