Skip to content

v3.2: Consider requiring $self to be an absolute-URI #4548

Closed

Description

@handrews

@mikekistler wrote in #4389 (comment):

this seems like the exact situation where you want to use absolute $self value. I thought the idea of distinguishing URIs -- identifiers -- from URLs -- locators -- is that you could have the same document in multiple locations and would want to make clear that it is the same document -- with a single identifier -- even though it could be retrieved from multiple locations.

Restricting $self to absolute URIs would break the analogy with $id but would simplify things.

This is somewhat related to issue #4541 which questions the decision to have API URLs ignore $self because if you do have multiple API instances, hosting a copy of the OAD in a location relative to the instance allows using the same OAD at runtime to work with multiple API instances.

This contrasts with $self which is concerned with the load-time identity of the individual document. We would still use other RFC3986 sources (including the retrieval URI if no base URI is available from an encapsulating entity) for the base URI when $self is not present, but we would no longer have to explain/support the "what if $self is relative" scenario.

Also paging @karenetheridge

Activity

  1. added this to the v3.2.0 milestone on Apr 23, 2025
  2. lornajane commented on Apr 24, 2025

    @lornajane
    Contributor

    We had a lively discussion about whether a relative $self is useful when its absence would mean falling through to the retrieval location anyway. Please add your thoughts here async and we will revisit this discussion.

  3. lornajane commented on May 15, 2025

    @lornajane
    Contributor

    Final discussion: support both relative and absolute (see #4556 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    re-use: ref/id resolutionhow $ref, operationId, or anything else is resolved

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions