From 5f027d6596bbdd27c73ab7232c1ed661d19d3342 Mon Sep 17 00:00:00 2001
From: "Stuart P. Bentley" <s@stuartpb.com>
Date: Tue, 14 Nov 2017 23:17:02 -0800
Subject: [PATCH] Add further.requirements for forms (#7)

---
 draft/docs/forms.md       |  4 ++
 draft/profiles.copld.yaml | 55 ++++++++++++++++++++++
 draft/profiles.json       | 99 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 158 insertions(+)

diff --git a/draft/docs/forms.md b/draft/docs/forms.md
index 4d43972..5c0a826 100644
--- a/draft/docs/forms.md
+++ b/draft/docs/forms.md
@@ -122,3 +122,7 @@ If a checkbox for this is present, it will be described as the `login.form.persi
 ## Terms agreement
 
 The `registration.form.terms.agreement` property describes whether registration features a `checkbox` to denote that you agree to the site's legal terms, or if the agreement to terms is spelled out as `implicit` (ie. "By clicking the Submit button, you agree to...").
+
+## Further requirements
+
+Required information or steps not described by other properties under `form` may have a `further.requirements` list describing these requirements, following the [documentation on descriptions](descriptions.md).
diff --git a/draft/profiles.copld.yaml b/draft/profiles.copld.yaml
index 51169c2..ca639cf 100644
--- a/draft/profiles.copld.yaml
+++ b/draft/profiles.copld.yaml
@@ -303,6 +303,11 @@ definitions:
         captcha:
           $ref: "#/definitions/formcaptcha"
 
+        further.:
+
+          requirements:
+            $ref: "#/definitions/desclist"
+
 # body #
 
 type: object
@@ -511,6 +516,11 @@ properties:
             account:
               $ref: "#/definitions/accountfield"
 
+            further.:
+
+              requirements:
+                $ref: "#/definitions/desclist"
+
         submit.:
 
           destination.:
@@ -655,6 +665,11 @@ properties:
           oldpassword:
             $ref: "#/definitions/formfield"
 
+          further.:
+
+            requirements:
+              $ref: "#/definitions/desclist"
+
       form.:
 
         oldpassword:
@@ -668,6 +683,11 @@ properties:
           newpassword:
             $ref: "#/definitions/formfield"
 
+        further.:
+
+          requirements:
+            $ref: "#/definitions/desclist"
+
       after.:
 
         form.:
@@ -675,6 +695,11 @@ properties:
           oldpassword:
             $ref: "#/definitions/formfield"
 
+          further.:
+
+            requirements:
+              $ref: "#/definitions/desclist"
+
       sessions.:
 
         own:
@@ -733,6 +758,11 @@ properties:
           captcha:
             $ref: "#/definitions/formcaptcha"
 
+          further.:
+
+            requirements:
+              $ref: "#/definitions/desclist"
+
       response.:
 
         email.:
@@ -767,6 +797,11 @@ properties:
           password:
             $ref: "#/definitions/formfield"
 
+          further.:
+
+            requirements:
+              $ref: "#/definitions/desclist"
+
       form.:
 
         password:
@@ -780,6 +815,11 @@ properties:
           newusername:
             $ref: "#/definitions/formfield"
 
+        further.:
+
+          requirements:
+            $ref: "#/definitions/desclist"
+
       after.:
 
         form.:
@@ -787,6 +827,11 @@ properties:
           password:
             $ref: "#/definitions/formfield"
 
+          further.:
+
+            requirements:
+              $ref: "#/definitions/desclist"
+
     documentation:
       type: array
       minItems: 1
@@ -872,6 +917,11 @@ properties:
         circumstances:
           $ref: "#/definitions/desclist"
 
+      further.:
+
+        requirements:
+          $ref: "#/definitions/desclist"
+
   login.:
 
     url:
@@ -894,6 +944,11 @@ properties:
       password:
         $ref: "#/definitions/formfield"
 
+      further.:
+
+        requirements:
+          $ref: "#/definitions/desclist"
+
       persist.:
 
         checkbox:
diff --git a/draft/profiles.json b/draft/profiles.json
index 60ed56c..d3b23a6 100644
--- a/draft/profiles.json
+++ b/draft/profiles.json
@@ -342,6 +342,15 @@
             },
             "captcha": {
               "$ref": "#/definitions/formcaptcha"
+            },
+            "further": {
+              "type": "object",
+              "properties": {
+                "requirements": {
+                  "$ref": "#/definitions/desclist"
+                }
+              },
+              "minimumProperties": 1
             }
           },
           "minimumProperties": 1
@@ -624,6 +633,15 @@
                         },
                         "account": {
                           "$ref": "#/definitions/accountfield"
+                        },
+                        "further": {
+                          "type": "object",
+                          "properties": {
+                            "requirements": {
+                              "$ref": "#/definitions/desclist"
+                            }
+                          },
+                          "minimumProperties": 1
                         }
                       },
                       "minimumProperties": 1
@@ -841,6 +859,15 @@
                   "properties": {
                     "oldpassword": {
                       "$ref": "#/definitions/formfield"
+                    },
+                    "further": {
+                      "type": "object",
+                      "properties": {
+                        "requirements": {
+                          "$ref": "#/definitions/desclist"
+                        }
+                      },
+                      "minimumProperties": 1
                     }
                   },
                   "minimumProperties": 1
@@ -865,6 +892,15 @@
                     }
                   },
                   "minimumProperties": 1
+                },
+                "further": {
+                  "type": "object",
+                  "properties": {
+                    "requirements": {
+                      "$ref": "#/definitions/desclist"
+                    }
+                  },
+                  "minimumProperties": 1
                 }
               },
               "minimumProperties": 1
@@ -877,6 +913,15 @@
                   "properties": {
                     "oldpassword": {
                       "$ref": "#/definitions/formfield"
+                    },
+                    "further": {
+                      "type": "object",
+                      "properties": {
+                        "requirements": {
+                          "$ref": "#/definitions/desclist"
+                        }
+                      },
+                      "minimumProperties": 1
                     }
                   },
                   "minimumProperties": 1
@@ -958,6 +1003,15 @@
                     },
                     "captcha": {
                       "$ref": "#/definitions/formcaptcha"
+                    },
+                    "further": {
+                      "type": "object",
+                      "properties": {
+                        "requirements": {
+                          "$ref": "#/definitions/desclist"
+                        }
+                      },
+                      "minimumProperties": 1
                     }
                   },
                   "minimumProperties": 1
@@ -1014,6 +1068,15 @@
                   "properties": {
                     "password": {
                       "$ref": "#/definitions/formfield"
+                    },
+                    "further": {
+                      "type": "object",
+                      "properties": {
+                        "requirements": {
+                          "$ref": "#/definitions/desclist"
+                        }
+                      },
+                      "minimumProperties": 1
                     }
                   },
                   "minimumProperties": 1
@@ -1038,6 +1101,15 @@
                     }
                   },
                   "minimumProperties": 1
+                },
+                "further": {
+                  "type": "object",
+                  "properties": {
+                    "requirements": {
+                      "$ref": "#/definitions/desclist"
+                    }
+                  },
+                  "minimumProperties": 1
                 }
               },
               "minimumProperties": 1
@@ -1050,6 +1122,15 @@
                   "properties": {
                     "password": {
                       "$ref": "#/definitions/formfield"
+                    },
+                    "further": {
+                      "type": "object",
+                      "properties": {
+                        "requirements": {
+                          "$ref": "#/definitions/desclist"
+                        }
+                      },
+                      "minimumProperties": 1
                     }
                   },
                   "minimumProperties": 1
@@ -1168,6 +1249,15 @@
                 }
               },
               "minimumProperties": 1
+            },
+            "further": {
+              "type": "object",
+              "properties": {
+                "requirements": {
+                  "$ref": "#/definitions/desclist"
+                }
+              },
+              "minimumProperties": 1
             }
           },
           "minimumProperties": 1
@@ -1199,6 +1289,15 @@
             "password": {
               "$ref": "#/definitions/formfield"
             },
+            "further": {
+              "type": "object",
+              "properties": {
+                "requirements": {
+                  "$ref": "#/definitions/desclist"
+                }
+              },
+              "minimumProperties": 1
+            },
             "persist": {
               "type": "object",
               "properties": {