From beef97f5dbf85643ec2bfad69fcb22c35b4977f3 Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Tue, 22 Dec 2015 11:27:29 -0500 Subject: [PATCH 1/2] Add JSON pointers to spec --- spec/README.md | 36 ++++++++++++++++++++++++++++++++++++ spec/param.json | 6 +++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/spec/README.md b/spec/README.md index 40f3620..fc4e453 100644 --- a/spec/README.md +++ b/spec/README.md @@ -186,6 +186,42 @@ Field Name | Type | Description default | `string` | **Optional** An optional default value for the parameter. hidden | `string` | **Optional** An optional boolean signifying the parameter should be obscured when displayed. +##### JSON Pointers +JSON Pointers (otherwise known as XPathing) are supported by the Nulecule specification by implementing [RFC 6902](https://tools.ietf.org/html/rfc6902). +A value can be provided by using the pointer reference within the JSON/Yaml format. + +ex. +```yaml +description: mongoDB Admin password +hidden: true +constraints: + - allowed_pattern: "[A-Z0-9]+" + description: Must consist of characters and numbers only. + default: 0 + param: + - /spec/containers/0/param +``` +```json +{ + "name": "password", + "description": "mongoDB Admin password", + "hidden": true, + "constraints": [ + { + "allowed_pattern": "[A-Z0-9]+", + "description": "Must consist of characters and numbers only.", + "default": 0, + "param": { + "description": "An array of JSON pointers per RFC 6902.", + "type": "array", + "default": null + } + } + ] +} +``` + + ##### Parameters Object Example: ```yaml diff --git a/spec/param.json b/spec/param.json index 18f9811..20aeb97 100644 --- a/spec/param.json +++ b/spec/param.json @@ -28,6 +28,10 @@ "description": "An optional boolean signifying the parameter should be obscured when displayed.", "type": "boolean", "default": false - } + }, + "param": [ + "/spec/containers/0/param", + "/spec/containers/1/param" + ] } } From 4bccf241ed5e78d760ce0e7c8de40894e15ac828 Mon Sep 17 00:00:00 2001 From: Aaron Weitekamp Date: Tue, 22 Dec 2015 14:20:35 -0500 Subject: [PATCH 2/2] Describe param as structured data --- spec/param.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec/param.json b/spec/param.json index 20aeb97..d865066 100644 --- a/spec/param.json +++ b/spec/param.json @@ -29,9 +29,10 @@ "type": "boolean", "default": false }, - "param": [ - "/spec/containers/0/param", - "/spec/containers/1/param" - ] + "param": { + "description": "An array of XPath strings per RFC 6902.", + "type": "array", + "default": "null" + } } }