Resource IDs should not be restricted to type UUID

Aperta
#667 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
yaml
Ambito
api

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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}$
Lingua principale
JavaScript
Stelle
105
Fork
72
Merge medio
11h 49m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SignalK/specification

Tutte le issue di SignalK/specification

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.