xregistry / spec

xRegistry related specifications
https://xRegistry.io
Apache License 2.0
35 stars 6 forks source link

Resource/Version model alignment changes #141

Closed duglin closed 3 months ago

duglin commented 3 months ago

Proposal:

{
  "id": "STRING",                          # The Resource id
  "self": "URL",                           # Resource URL, not Version

  # These are inherited from the default Version (excluded on export)
  "versionid": "STRING",                   # Same a defaultversionid
  "name": "STRING", ?
  "epoch": UINTEGER,
  "isdefault": true,
  "description": "STRING", ?
  "documentation": "URL", ?
  "labels": { "STRING": "STRING" * }, ?
  "origin": "URI", ?
  "createdat": "TIME",
  "modifiedat": "TIME",
  "contenttype": "STRING, ?

  "RESOURCEurl": "URL", ?                  # If not local
  "RESOURCE": ... Resource document ..., ? # If local & inlined & JSON
  "RESOURCEbase64": "STRING", ?            # If local & inlined & ~JSON

  # These are Resource-only attributes
  "xref": "URL", ?                         # Ptr to other Resource

  "defaultversionsticky": BOOLEAN, ?
  "defaultversionid": "STRING",            # Same as versionid above
  "defaultversionurl": "URL",

  "versionsurl": "URL",
  "versionscount": UINTEGER,
  "versions": {                            # Only if inlined/nested
    "ID": {                                # The Version's versionid
      "id": "STRING",                      # The Resource id
      "self": "URL",                       # Version URL
      "versionid": "STRING",
      "name": "STRING", ?
      "epoch": UINTEGER,
      "isdefault": BOOLEAN, ?
      "description": "STRING", ?
      "documentation": "URL", ?
      "labels": { "STRING": "STRING" * }, ?
      "origin": "URI", ?
      "createdat": "TIME",
      "modifiedat": "TIME",
      "contenttype": "STRING", ?

      "RESOURCEurl": "URL", ?                  # If not local
      "RESOURCE": ... Resource document ..., ? # If inlined & JSON
      "RESOURCEbase64": "STRING" ?             # If inlined & ~JSON
    } *
  }
}