Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource IDs should not be restricted to type UUID #667

Open
KvotheBloodless opened this issue Feb 14, 2025 · 0 comments
Open

Resource IDs should not be restricted to type UUID #667

KvotheBloodless opened this issue Feb 14, 2025 · 0 comments

Comments

@KvotheBloodless
Copy link

KvotheBloodless commented Feb 14, 2025

The specification demands that the ID of a resource be of type UUID, however, the implementation does not seem to require it in the case of resource plugins. The implementation does seem to require it for the href attribute of notes.

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}$
@KvotheBloodless KvotheBloodless changed the title HrefAttribute.href should not specify type of UUID Resource IDs should not specify type of UUID Feb 14, 2025
@KvotheBloodless KvotheBloodless changed the title Resource IDs should not specify type of UUID Resource IDs should not be restricted to type UUID Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant