Problem/Motivation

It would be nice to also support an endpoint for 2.1. The only changes from 2.0 to 2.1 seem to be the addition of a software.repository and software.homepage properties.

diff between 2.0 and 2.1 schema

--- 2.0.json   2024-11-09 16:25:10.250036391 -0500
+++ 2.1.json   2024-11-09 16:24:24.852036823 -0500
@@ -1,7 +1,7 @@
 {
   "$schema": "http://json-schema.org/draft-04/schema#",
-  "id": "http://nodeinfo.diaspora.software/ns/schema/2.0#",
-  "description": "NodeInfo schema version 2.0.",
+  "id": "http://nodeinfo.diaspora.software/ns/schema/2.1#",
+  "description": "NodeInfo schema version 2.1.",
   "type": "object",
   "additionalProperties": false,
   "required": [
@@ -15,9 +15,9 @@
   ],
   "properties": {
     "version": {
-      "description": "The schema version, must be 2.0.",
+      "description": "The schema version, must be 2.1.",
       "enum": [
-        "2.0"
+        "2.1"
       ]
     },
     "software": {
@@ -37,6 +37,14 @@
         "version": {
           "description": "The version of this server software.",
           "type": "string"
+        },
+        "repository": {
+          "description": "The url of the source code repository of this server software.",
+          "type": "string"
+        },
+        "homepage": {
+          "description": "The url of the homepage of this server software.",
+          "type": "string"
         }
       }
     },

Proposed resolution

- Refactor nodeinfo.content route to use a version string parameter.
- Only apply the additional properties when version string is 2.1.
- Add both 2.0 and 2.1 in the nodeinfo.nodeinfo route response.

Remaining tasks

User interface changes

Route URL has version, but this is seamless.

API changes

NodeInfoController::content(?string $version = 2.0) should be backwards compatible, if necessary.

Data model changes

Addition of software.repository and software.homepage properties when version is 2.1.

Issue fork nodeinfo-3486520

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mradcliffe created an issue. See original summary.

mradcliffe’s picture

Status: Active » Needs review
mradcliffe’s picture

I added a test as well, but this will probably fail due to #3433617: Automated Drupal 11 compatibility fixes for nodeinfo.

mradcliffe’s picture

That should do it. Tests pass for Drupal 10 (previous major) and won't pass for Drupal 11 until module is compatible with Drupal 11.

swentel’s picture

committed the patch to support D11

maybe add following to gitlab file so we test (at least) the previous major?

variables:
OPT_IN_TEST_PREVIOUS_MAJOR: 1
OPT_IN_TEST_PREVIOUS_MINOR: 1

mradcliffe’s picture

I've been running nodeinfo with this patch for about a month or so without any ill effects. Appreciate any additional manual testing to try to get this RTBC.

mradcliffe’s picture

I've been running with the patch for over a year without any issues.