Skip to content

[Spec] Should we disallow property names in paths? #1108

@Polleps

Description

@Polleps

Paths are a way to fetch resources multiple levels deep.
They are also a way to identify anonymous resources.

Currently we allow the use of property short-names in place of the full property url. This makes it more easy for a user to type the path.

There are 3 issues with this:

  1. It makes it harder for an implementor to build features around it. The implementation needs to fetch the resource at the first index, then fetch each property to figure out if any of them have the name at the second index. It needs to implement logic for when there are multiple properties with the same name. This can go on for multiple levels and can potentially be very inefficient if the properties are not already in the cache.
  2. When multiple properties have the same name, the first one gets chosen. This means that the resolve mechanism is dependent on the data present in the resource at that time. If the name of the property changes it no longer works or if the property is optional and the value is removed the path suddenly points to another resource.
  3. Allowing short-names means paths can't be canonical and using them as identifiers for anonymous resources can be problematic. You can't compare two paths and determine they are not the same resource because one of them uses a shortname while the other does not.

One solution would be to disallow them in the spec but still allow them in atomic-cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions