Resource IDs should not be restricted to type UUID

Open
#667 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
yaml
Domain
api

Research direction

Locate the schema definitions for HrefAttribute, SignalKUuid, and SignalKHref shown in the issue, and read how resource IDs are constrained there. Check how the href pattern and UUID schema are used before deciding what needs to change. Done means resource IDs can use formats other than UUIDs without breaking the resource reference definition.

Written by the indexing model from the issue text.

Description

The specification demands that the ID of a resource be of type UUID.

I would argue that there is no good reason to require a UUID type for a resource ID. Resource provider implementations can benefit from the freedom of using the ID format of their choice. In the case of the signalk-activecaptain-resources plugin, the resource entities are owned by a third party system outside of our control and are proxied by the plugin. The external IDs are of type integer. It would require complex mapping if we were forced to use UUIDs.

HrefAttribute:
      type: object
      required:
        - href
      properties:
        href:
          description: Reference to a related resource. A pointer to the resource UUID.
          example: /resources/waypoints/ac3a3b2d-07e8-4f25-92bc-98e7c92f7f1a
          allOf:
            $ref: '#/components/schemas/SignalKHref'

    SignalKUuid:
      type: string
      pattern: '[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$'
      example: ac3a3b2d-07e8-4f25-92bc-98e7c92f7f1a
    
    SignalKHref:
      type: string
      pattern: ^/resources/(\w*)/[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$
Dominant language
JavaScript
Stars
105
Forks
72
Avg merge
11h 49m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SignalK/specification

All issues in SignalK/specification

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.