You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -307,11 +307,11 @@ The JSON object returned by ``serial.metadata.as_json()`` will now use this anno
307
307
"dir": "out",
308
308
"width": 1,
309
309
"signed": false,
310
-
"reset": 0
310
+
"reset": "0"
311
311
}
312
312
},
313
313
"annotations": {
314
-
"com.example.serial": {
314
+
"com.example.foo.serial": {
315
315
"data_bits": 8,
316
316
"parity": "none"
317
317
}
@@ -322,13 +322,30 @@ The JSON object returned by ``serial.metadata.as_json()`` will now use this anno
322
322
323
323
#### Annotation names and schema URLs
324
324
325
-
Annotation names must be prefixed by a reversed domain name (e.g. "com.example") that belongs to the person or entity defining the annotation. Annotation names are obtainable from their schema URL (provided by the `"$id"` key of `Annotation.schema`). To ensure this, schema URLs must have the following structure: `"<protocol>://<domain>/schema/<path>/<version>.json"`. The version of an annotation schema should match the Python package that implements it.
325
+
An `Annotation` schema must have a `"$id"` property, which holds an URL that serves as its unique identifier. This URL must have the following format:
*`<domain>` is a domain name registered to the person or entity defining the annotation;
332
+
*`<package>` is the name of the Python package providing the `Annotation` subclass;
333
+
*`<version>` is the version of the aforementioned package;
334
+
*`<path>` is a non-empty string.
335
+
336
+
An `Annotation` name should be retrievable from the `"$id"` property of its schema. Its name is the concatenation of the following parts, separated by `"."`:
337
+
338
+
*`<domain>`, reversed (e.g. "com.example");
339
+
*`<package>`;
340
+
*`<path>`, split using `"/"` as separator.
326
341
327
342
Some examples of valid schema URLs:
328
343
329
-
- "https://example.github.io/schema/serial/1.0.json" for the "io.github.example.serial" annotation;
330
-
- "https://amaranth-lang.org/schema/amaranth/fifo/4.0.json" for "org.amaranth-lang.amaranth.fifo";
331
-
- "https://amaranth-lang.org/schema/amaranth-soc/memory-map/1.0.json" for "org.amaranth-lang.amaranth-soc.memory-map".
344
+
- "https://example.github.io/schema/foo/1.0/serial.json" for the "io.github.example.foo.serial" annotation;
345
+
- "https://amaranth-lang.org/schema/amaranth/0.4/fifo.json" for "org.amaranth-lang.amaranth.fifo";
346
+
- "https://amaranth-lang.org/schema/amaranth-soc/0.1/memory-map.json" for "org.amaranth-lang.amaranth-soc.memory-map".
347
+
348
+
Changes to schema definitions hosted at https://amaranth-lang.org should follow the [RFC process](https://github.com/amaranth-lang/rfcs).
0 commit comments