Skip to content

Commit 743263d

Browse files
added links to parent document for smartAPI fields
1 parent 1d25b75 commit 743263d

File tree

2 files changed

+32
-29
lines changed

2 files changed

+32
-29
lines changed

versions/smartapi-list.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
Object | Field | Recommendation | Datatype | Description
22
---|:---:|:---:|:---:|---
3-
OpenAPI Object|x-externalResources||External Resource Object|A list of external resources pertinent to the API.
4-
Info Object|description|SHOULD| string |See <a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.mdfixed-fields-1">above</a>.
5-
Info Object|termsOfService|REQUIRED| URL |See <a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.mdfixed-fields-1">above</a>.
6-
Info Object|version|REQUIRED| string |The version of the API definition. Specify API version using <a href="http://semver.org/spec/v2.0.0.html">Semantic Versioning<a/>. The major.minor portion of the semver (for example 3.0) shall designate the feature set. Typically, .patch versions address errors in the API metadata, not the feature set.
7-
Info Object|x-maturity|| enum |Maturity of the API. Values to use: development, production.
8-
Info Object|x-accessRestriction|| enum |Indicate whether there are restrictions to using the API. Values to use: none, limited, fee.
9-
Info Object|x-implementationLanguage|| string |Language the API was written in.
10-
Contact Object|x-role|REQUIRED| enum |Indicate the role of the contact. Values can be: `responsible organization`,`responsible developer`,`contributor`,`support`.
11-
Contact Object|x-id|SHOULD| string |Provide a unique identifier for the contact.
12-
Operation Object|summary|REQUIRED| string |See <a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.mdoperation-object">above.</a>
13-
Operation Object|x-accessRestriction|| enum |Access restrictions to invoke the operation. values: none, limited, fee.
14-
External Resource Object [smartAPI extension]|x-url|REQUIRED| string |. The URL for the target documentation. Value MUST be in the format of a URL.
15-
External Resource Object [smartAPI extension]|x-type|REQUIRED| enum |values: `api documentation`, `website`,`developer forum`,`mailing list`,`social media`,`publication` </a>
16-
External Resource Object [smartAPI extension]|x-description|| string |A short description of the target documentation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
17-
Parameter Object|x-parameterType|SHOULD| uri |A concept URI to describe the type of parameter.
18-
Parameter Object|x-valueType|SHOULD| [uri] |A list of URIs to define the types of accepted value types. These should be selected from a registry of value types such as identifiers.org. This attribute is different from
19-
Parameter Object|x-defaultValue|| string |Default value.
20-
Parameter Object|x-exampleValue|| string |Example value.
21-
Response Object|content|| Map[string, [Media Type Object](#mediaTypeObject)] |A map containing descriptions of potential response payloads. The key is the media type and the value is used to describe it.The media type definitions should be in compliance with <a href="http://tools.ietf.org/html/rfc6838">RFC6838</a>.
22-
Response Object|x-responseSchema|| URI |Conformance to a particular schema/format.
23-
Response Object|x-responseValueType|| [responseValueType object] |To specify the types of objects in the response. The responseValueType object consists of a required `x-valueType` that should provide URI values to the type of object, and an optional `x-path` to specify to ___location in the response for that valueType.
24-
Response Object|x-JSONLDContext|| URI |JSON LD context.
25-
Tag Object|x-id|| URI |The name of the tag. Recommend that you use URI to specify the concept.
3+
OpenAPI Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#oasExternalResources">x-externalResources</a>||External Resource Object|A list of external resources pertinent to the API.
4+
Info Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#infoDescription">description</a>|SHOULD| string |See <a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.mdfixed-fields-1">above</a>.
5+
Info Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#infoTermsOfService">termsOfService</a>|REQUIRED| URL |See <a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.mdfixed-fields-1">above</a>.
6+
Info Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#infoVersion">version</a>|REQUIRED| string |The version of the API definition. Specify API version using <a href="http://semver.org/spec/v2.0.0.html">Semantic Versioning<a/>. The major.minor portion of the semver (for example 3.0) shall designate the feature set. Typically, .patch versions address errors in the API metadata, not the feature set.
7+
Info Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#infoMaturity">x-maturity</a>|| enum |Maturity of the API. Values to use: development, production.
8+
Info Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#infoAccessRestriction">x-accessRestriction</a>|| enum |Indicate whether there are restrictions to using the API. Values to use: none, limited, fee.
9+
Info Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#infoImplementationLanguage">x-implementationLanguage</a>|| string |Language the API was written in.
10+
Contact Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#contactRole">x-role</a>|REQUIRED| enum |Indicate the role of the contact. Values can be: `responsible organization`,`responsible developer`,`contributor`,`support`.
11+
Contact Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#contactId">x-id</a>|SHOULD| string |Provide a unique identifier for the contact.
12+
Operation Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#operationSummary">summary</a>|REQUIRED| string |See <a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.mdoperation-object">above.</a>
13+
Operation Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#operationAccessRestriction">x-accessRestriction</a>|| enum |Access restrictions to invoke the operation. values: none, limited, fee.
14+
External Resource Object [smartAPI extension]|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#externalResourceUrl">x-url</a>|REQUIRED| string |. The URL for the target documentation. Value MUST be in the format of a URL.
15+
External Resource Object [smartAPI extension]|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#externalResourceType">x-type</a>|REQUIRED| enum |values: `api documentation`, `website`,`developer forum`,`mailing list`,`social media`,`publication` </a>
16+
External Resource Object [smartAPI extension]|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#externalResourceDescription">x-description</a>|| string |A short description of the target documentation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
17+
Parameter Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#parameterType">x-parameterType</a>|SHOULD| uri |A concept URI to describe the type of parameter.
18+
Parameter Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#parameterValueType">x-valueType</a>|SHOULD| [uri] |A list of URIs to define the types of accepted value types. These should be selected from a registry of value types such as identifiers.org. This attribute is different from
19+
Parameter Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#parameterDefaultValue">x-defaultValue</a>|| string |Default value.
20+
Parameter Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#parameterExampleValue">x-exampleValue</a>|| string |Example value.
21+
Response Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#responseContent">content</a>|| Map[string, [Media Type Object](#mediaTypeObject)] |A map containing descriptions of potential response payloads. The key is the media type and the value is used to describe it.The media type definitions should be in compliance with <a href="http://tools.ietf.org/html/rfc6838">RFC6838</a>.
22+
Response Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#responseProfile">x-responseSchema</a>|| URI |Conformance to a particular schema/format.
23+
Response Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#responseDataType">x-responseValueType</a>|| [responseValueType object] |To specify the types of objects in the response. The responseValueType object consists of a required `x-valueType` that should provide URI values to the type of object, and an optional `x-path` to specify to ___location in the response for that valueType.
24+
Response Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#x-JSONLDContext">x-JSONLDContext</a>|| URI |JSON LD context.
25+
Tag Object|<a href="https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md#tagName">x-id</a>|| URI |The name of the tag. Recommend that you use URI to specify the concept.

versions/smartapi-list.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
$file = "3.0.0.md";
4+
$parent_doc = 'https://github.com/SmartAPI/smartAPI-Specification/blob/OpenAPI.next/versions/3.0.0.md';
45
$str = file_get_contents($file);
56

67
$list = preg_split("/#### <a name=\"[^\"]+\"><\/a>/",$str, -1); // <a name="[^\"]+"></a>OpenAPI Object
@@ -12,8 +13,6 @@
1213
foreach($list as $item) {
1314
$a = explode("\n",$item, 2);
1415
$object_label = trim($a[0]);
15-
16-
//echo $object_label.PHP_EOL;
1716

1817
// now find the smartapi section
1918
$record = false;
@@ -36,9 +35,12 @@
3635
preg_match("/\[\[([^\]]+)\]/",$datatype,$m);
3736
if(isset($m[1])) $datatype = $m[1];
3837
}
39-
$desc = $cols[2];
40-
preg_match("/a>(.*)/",$cols[0],$m);
41-
$field = trim($m[1]);
38+
$desc = $cols[2];
39+
40+
// field
41+
preg_match("/<a name=\"([^\"]+)\"><\/a>(.*)/",$cols[0],$m);
42+
$link = trim($m[1]);
43+
$field = trim($m[2]);
4244

4345
// recommendation
4446
preg_match('/\*\*([^\*]+)/',$desc,$m); //([^*]+)**/',$desc,$m);
@@ -52,6 +54,7 @@
5254
$mylist[$object_label][$field]['rec'] = $rec;
5355
$mylist[$object_label][$field]['desc'] = trim($desc);
5456
$mylist[$object_label][$field]['datatype'] = $datatype;
57+
$mylist[$object_label][$field]['link'] = $link;
5558
}
5659
}
5760
}
@@ -71,7 +74,7 @@
7174
foreach($mylist AS $object => $o) {
7275
foreach($o as $field => $field_desc) {
7376
fwrite($fp,$object
74-
."|".$field
77+
."|".'<a href="'.$parent_doc.'#'.$field_desc['link'].'">'.$field.'</a>'
7578
."|".$field_desc['rec']
7679
."|".$field_desc['datatype']
7780
."|".$field_desc['desc']

0 commit comments

Comments
 (0)