diff --git a/docs/guide/extensions.ipynb b/docs/guide/extensions.ipynb index 9dcbdb28..9bd1c569 100644 --- a/docs/guide/extensions.ipynb +++ b/docs/guide/extensions.ipynb @@ -59,11 +59,11 @@ "source": [ "## STIX Extensions\n", "\n", - "This page is specific for the STIX Extensions mechanism defined in STIX 2.1 CS 02. For the deprecated STIX Customization mechanisms see the [Custom](custom.ipynb) section.\n", + "This page is specific for the STIX Extensions mechanism defined in STIX 2.1 CS 03. For the deprecated STIX Customization mechanisms see the [Custom](custom.ipynb) section.\n", "\n", "### Top Level Property Extensions\n", "\n", - "The example below shows how to create an `indicator` object with a `top-level-property-extension`. " + "The example below shows how to create an `indicator` object with a `toplevel-property-extension`. Because an unregistered toplevel property extension is present, any unrecognized toplevel properties are assumed to be extension properties. So the library lets them pass. " ] }, { @@ -74,116 +74,11 @@ { "data": { "text/html": [ - "
{\n",
-       "    "type": "extension-definition",\n",
-       "    "spec_version": "2.1",\n",
-       "    "id": "extension-definition--dd73de4f-a7f3-49ea-8ec1-8e884196b7a8",\n",
-       "    "created_by_ref": "identity--11b76a96-5d2b-45e0-8a5a-f6994f370731",\n",
-       "    "created": "2014-02-20T09:16:08.000Z",\n",
-       "    "modified": "2014-02-20T09:16:08.000Z",\n",
-       "    "name": "New SDO 1",\n",
-       "    "description": "This schema adds two properties to a STIX object at the toplevel",\n",
-       "    "schema": "https://www.example.com/schema-foo-1a/v1/",\n",
-       "    "version": "1.2.1",\n",
-       "    "extension_types": [\n",
-       "        "toplevel-property-extension"\n",
-       "    ],\n",
-       "    "extension_properties": [\n",
-       "        "toxicity",\n",
-       "        "rank"\n",
-       "    ]\n",
-       "}\n",
-       "
\n" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - }, - { - "data": { - "text/html": [ - "
{\n",
        "    "type": "marking-definition",\n",
        "    "spec_version": "2.1",\n",
-       "    "id": "marking-definition--28417f9f-1963-4e7f-914d-233f8fd4829f",\n",
-       "    "created": "2021-03-31T21:54:46.652069Z",\n",
+       "    "id": "marking-definition--9155f07c-dd4c-4320-be6a-0701311c3b84",\n",
+       "    "created": "2021-07-12T00:56:31.47566Z",\n",
        "    "name": "This is the name of my favorite Marking",\n",
        "    "extensions": {\n",
        "        "extension-definition--a932fcc6-e032-176c-126f-cb970a5a1fff": {\n",
-       "            "extension_type": "property-extension"\n",
+       "            "extension_type": "property-extension",\n",
+       "            "some_marking_field": "value"\n",
        "        }\n",
        "    }\n",
        "}\n",
@@ -742,24 +621,23 @@
     }
    ],
    "source": [
-    "from stix2 import registry\n",
+    "import stix2\n",
+    "import stix2.properties\n",
     "\n",
     "MARKING_EXTENSION_ID = 'extension-definition--a932fcc6-e032-176c-126f-cb970a5a1fff'\n",
     "\n",
-    "@stix2.v21.CustomMarking(\n",
-    "    'my-favorite-marking', [\n",
-    "        ('some_marking_field', stix2.properties.StringProperty(required=True)),\n",
-    "    ], MARKING_EXTENSION_ID,\n",
-    ")\n",
+    "@stix2.CustomExtension(MARKING_EXTENSION_ID, [\n",
+    "    ('some_marking_field', stix2.properties.StringProperty(required=True))\n",
+    "])\n",
     "class MyFavMarking:\n",
-    "    pass\n",
-    "\n",
-    "ext_class = registry.class_for_type(MARKING_EXTENSION_ID, '2.1')\n",
+    "    extension_type = 'property-extension'\n",
     "\n",
-    "my_favorite_marking = MyFavMarking(\n",
+    "my_favorite_marking = stix2.MarkingDefinition(\n",
     "    name='This is the name of my favorite Marking',\n",
     "    extensions={\n",
-    "        MARKING_EXTENSION_ID: ext_class(some_marking_field='value')\n",
+    "        MARKING_EXTENSION_ID: MyFavMarking(\n",
+    "            some_marking_field='value'\n",
+    "        )\n",
     "    }\n",
     ")\n",
     "\n",
@@ -908,7 +786,7 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 3",
+   "display_name": "Python 3 (ipykernel)",
    "language": "python",
    "name": "python3"
   },
@@ -922,7 +800,7 @@
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.9.2"
+   "version": "3.8.1"
   }
  },
  "nbformat": 4,
diff --git a/docs/guide/parsing.ipynb b/docs/guide/parsing.ipynb
index 0e891261..452f5704 100644
--- a/docs/guide/parsing.ipynb
+++ b/docs/guide/parsing.ipynb
@@ -64,7 +64,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Parsing STIX content is as easy as calling the [parse()](../api/stix2.parsing.rst#stix2.parsing.parse) function on a JSON string, dictionary, or file-like object. It will automatically determine the type of the object. The STIX objects within `bundle` objects, and any cyber observables contained within `observed-data` objects will be parsed as well.\n",
+    "Parsing STIX content is as easy as calling the [parse()](../api/stix2.parsing.rst#stix2.parsing.parse) function on a JSON string, dictionary, or file-like object. It will automatically determine the type of the object. The STIX objects within `bundle` objects will be parsed as well.\n",
     "\n",
     "**Parsing a string**"
    ]
@@ -77,8 +77,13 @@
     {
      "data": {
       "text/html": [
-       "