From 35c3e1def98603d465cef7b80090f97314fe79c4 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Tue, 20 Apr 2021 20:40:00 +0200 Subject: [PATCH] General: Stabilize twig template usage Signed-off-by: Sean Molenaar --- .github/workflows/test.yml | 6 +- composer.json | 6 - .../Model/Elements/ArrayStructureElement.php | 4 +- .../Model/Elements/BasicStructureElement.php | 2 +- .../Model/Elements/EnumStructureElement.php | 4 +- .../Model/Elements/ObjectStructureElement.php | 6 +- .../Tests/EnumStructureElementTest.php | 4 +- .../Tests/ObjectStructureElementTest.php | 16 +-- src/PHPDraft/Out/HTML/default/main.css | 20 +++ src/PHPDraft/Out/HTML/default/main.twig | 21 +-- src/PHPDraft/Out/HTML/material/main.twig | 12 +- .../Out/Tests/TemplateRendererTest.php | 4 + src/PHPDraft/Out/Tests/TwigFactoryTest.php | 1 + src/PHPDraft/Out/TwigFactory.php | 2 - src/PHPDraft/Parse/DrafterAPI.php | 2 +- .../Parse/Tests/HtmlGeneratorTest.php | 6 - tests/statics/basic_html_template | 21 +-- tests/statics/drafter/html/basic.html | 122 ++++++++++++------ tests/statics/drafter/html/material.html | 113 ++++++++++------ tests/statics/empty_html_template | 21 +-- tests/statics/full_html_template | 21 +-- tests/statics/full_test.apib | 8 +- 22 files changed, 264 insertions(+), 158 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d655d961..ec32f8d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,10 +75,10 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run test suite - run: composer run-script test + run: ./vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=coverage.xml --exclude-group twig - name: PHPStan - run: phpstan analyse --level=5 src/ + run: ./vendor/bin/phpstan analyse --level=5 src/ - name: PHPCS run: phpcs --standard=tests/phpcs.xml --ignore=\*Minifier.php src/ | cs2pr @@ -110,7 +110,7 @@ jobs: run: composer update --no-interaction --no-suggest - name: Run test suite - run: composer run-script test-sonar + run: ./vendor/bin/phpunit --configuration tests/phpunit.xml --exclude-group twig --coverage-clover=./var/coverage/clover.xml - name: Code coverage Scan uses: codecov/codecov-action@v1 diff --git a/composer.json b/composer.json index 10012cf8..7233d79b 100644 --- a/composer.json +++ b/composer.json @@ -38,12 +38,6 @@ "phpstan/phpstan": "^0.12.17" }, "scripts": { - "test": [ - "vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=coverage.xml" - ], - "test-sonar": [ - "vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=./var/coverage/clover.xml" - ], "phar": [ "vendor/bin/phing phar", "sha256sum build/out/*" diff --git a/src/PHPDraft/Model/Elements/ArrayStructureElement.php b/src/PHPDraft/Model/Elements/ArrayStructureElement.php index fb398ada..0877f897 100644 --- a/src/PHPDraft/Model/Elements/ArrayStructureElement.php +++ b/src/PHPDraft/Model/Elements/ArrayStructureElement.php @@ -12,6 +12,8 @@ namespace PHPDraft\Model\Elements; +use Michelf\MarkdownExtra; + /** * Class ArrayStructureElement. */ @@ -58,7 +60,7 @@ public function __toString(): string if (is_string($this->value)) { $type = $this->get_element_as_html($this->element); - return '' . $this->key . '' . $type . '' . $this->description . ''; + return '' . $this->key . '' . $type . '' . MarkdownExtra::defaultTransform($this->description) . ''; } $return = ''; diff --git a/src/PHPDraft/Model/Elements/BasicStructureElement.php b/src/PHPDraft/Model/Elements/BasicStructureElement.php index 3a92dd3d..912442e4 100644 --- a/src/PHPDraft/Model/Elements/BasicStructureElement.php +++ b/src/PHPDraft/Model/Elements/BasicStructureElement.php @@ -117,7 +117,7 @@ protected function parse_common(object $object, array &$dependencies): void $this->description = htmlentities($object->meta->description); } if ($this->description !== null) { - $encoded = htmlentities($this->description, ENT_COMPAT, null, false); + $encoded = htmlentities($this->description, ENT_COMPAT, 'ISO-8859-1', false); $this->description = $encoded; } diff --git a/src/PHPDraft/Model/Elements/EnumStructureElement.php b/src/PHPDraft/Model/Elements/EnumStructureElement.php index 0ea09a5e..dce555fc 100644 --- a/src/PHPDraft/Model/Elements/EnumStructureElement.php +++ b/src/PHPDraft/Model/Elements/EnumStructureElement.php @@ -12,6 +12,8 @@ namespace PHPDraft\Model\Elements; +use Michelf\MarkdownExtra; + class EnumStructureElement extends BasicStructureElement { /** @@ -80,7 +82,7 @@ public function __toString(): string if (is_string($this->value)) { $type = $this->get_element_as_html($this->element); - return '' . $this->key->value . '' . $type . '' . $this->description . ''; + return '' . $this->key->value . '' . $type . '' . MarkdownExtra::defaultTransform($this->description) . ''; } $return = ''; diff --git a/src/PHPDraft/Model/Elements/ObjectStructureElement.php b/src/PHPDraft/Model/Elements/ObjectStructureElement.php index cc9d9095..6e720349 100644 --- a/src/PHPDraft/Model/Elements/ObjectStructureElement.php +++ b/src/PHPDraft/Model/Elements/ObjectStructureElement.php @@ -12,6 +12,8 @@ namespace PHPDraft\Model\Elements; +use Michelf\MarkdownExtra; + /** * Class ObjectStructureElement. */ @@ -20,7 +22,7 @@ class ObjectStructureElement extends BasicStructureElement /** * Object representation before parsing - * @var \stdClass + * @var \stdClass|null */ private $object; @@ -212,7 +214,7 @@ protected function construct_string_return(string $value): string '' . '' . $this->key->value . '' . $variable . '' . '' . $type . '' . ' ' . $this->status . '' . - '' . $this->description . '' . + '' . MarkdownExtra::defaultTransform($this->description) . '' . '' . $value . '' . ''; } diff --git a/src/PHPDraft/Model/Elements/Tests/EnumStructureElementTest.php b/src/PHPDraft/Model/Elements/Tests/EnumStructureElementTest.php index 48e43936..d1704498 100644 --- a/src/PHPDraft/Model/Elements/Tests/EnumStructureElementTest.php +++ b/src/PHPDraft/Model/Elements/Tests/EnumStructureElementTest.php @@ -77,7 +77,7 @@ public function testToStringWithString(): void $this->class->key->value = 'key'; $this->class->element = 'string'; $return = $this->class->__toString(); - $this->assertSame('keystring', $return); + $this->assertSame('keystring' . PHP_EOL . '', $return); } /** @@ -91,7 +91,7 @@ public function testToStringWithStringComplex(): void $this->class->key->value = 'key'; $this->class->element = 'Car'; $return = $this->class->__toString(); - $this->assertSame('keyCar', $return); + $this->assertSame('keyCar' . PHP_EOL . '', $return); } /** diff --git a/src/PHPDraft/Model/Elements/Tests/ObjectStructureElementTest.php b/src/PHPDraft/Model/Elements/Tests/ObjectStructureElementTest.php index bfaa2445..d7b62531 100644 --- a/src/PHPDraft/Model/Elements/Tests/ObjectStructureElementTest.php +++ b/src/PHPDraft/Model/Elements/Tests/ObjectStructureElementTest.php @@ -360,7 +360,7 @@ public function testToStringArray(): void $val->value = 'stuff'; $this->class->value = [$val]; $return = $this->class->__toString(); - $this->assertSame('
things
', $return); + $this->assertSame('
things' . PHP_EOL . '
', $return); } /** @@ -374,7 +374,7 @@ public function testToStringNullValue(): void $this->class->key->value = 'hello'; $this->class->type = 'mixed'; $return = $this->class->__toString(); - $this->assertSame('hellomixed ', $return); + $this->assertSame('hellomixed ' . PHP_EOL . '', $return); } /** @@ -389,7 +389,7 @@ public function testToStringObjectValue(): void $this->class->value = new ObjectStructureElement(); $this->class->type = 'object'; $return = $this->class->__toString(); - $this->assertSame('helloobject
{ }
', $return); + $this->assertSame('helloobject ' . PHP_EOL . '
{ }
', $return); } /** @@ -406,7 +406,7 @@ public function testToStringArrayValue(): void $this->class->value->value = 'value'; $this->class->type = 'array'; $return = $this->class->__toString(); - $this->assertSame('helloarray ', $return); + $this->assertSame('helloarray ' . PHP_EOL . '
value' . PHP_EOL . '
', $return); } /** @@ -426,7 +426,7 @@ public function testToStringEnumValue(): void $this->class->value->key->value = 'key'; $this->class->value->type = 'enum'; $return = $this->class->__toString(); - $this->assertSame('', $return); + $this->assertSame('
keyvalue' . PHP_EOL . '
', $return); } /** @@ -441,7 +441,7 @@ public function testToStringBoolValue(): void $this->class->value = true; $this->class->type = 'boolean'; $return = $this->class->__toString(); - $this->assertSame('helloboolean true', $return); + $this->assertSame('helloboolean ' . PHP_EOL . 'true', $return); } /** @@ -456,7 +456,7 @@ public function testToStringOtherValue(): void $this->class->value = 'world'; $this->class->type = 'Cow'; $return = $this->class->__toString(); - $this->assertSame('helloCow world', $return); + $this->assertSame('helloCow ' . PHP_EOL . 'world', $return); } /** @@ -471,6 +471,6 @@ public function testToStringOtherValueTypeKnown(): void $this->class->key->value = 'hello'; $this->class->value = 'world'; $return = $this->class->__toString(); - $this->assertSame('hellostring world', $return); + $this->assertSame('hellostring ' . PHP_EOL . 'world', $return); } } diff --git a/src/PHPDraft/Out/HTML/default/main.css b/src/PHPDraft/Out/HTML/default/main.css index 9184e904..f9f9975c 100644 --- a/src/PHPDraft/Out/HTML/default/main.css +++ b/src/PHPDraft/Out/HTML/default/main.css @@ -225,4 +225,24 @@ span.HEAD { } span.PATCH { color: var(--patch-color); +} + +h1.media-heading { + max-width: 80%; + word-break: break-word; +} + +.host-information { + position: absolute; + top: 0; + right: 0; +} + +.host-information label.host-dropdown { +} + +.host-information label.host-dropdown select { + border: 0 none rgba(0,0,0,0); + display: inherit; + width: auto; } \ No newline at end of file diff --git a/src/PHPDraft/Out/HTML/default/main.twig b/src/PHPDraft/Out/HTML/default/main.twig index b3399765..fb0ea402 100644 --- a/src/PHPDraft/Out/HTML/default/main.twig +++ b/src/PHPDraft/Out/HTML/default/main.twig @@ -4,8 +4,8 @@ {{ data.TITLE }} - - + + {% for style in css %} {% endfor %} @@ -15,9 +15,10 @@
-

{{ data.TITLE|raw }} +

{{ data.TITLE|raw }}

+
{% if data.ALT_HOST %} -
{% if data.DESC %} {{ data.DESC|markdown_to_html }} {% endif %} @@ -73,10 +74,10 @@ {% endfor %} - - - - + + + + \ No newline at end of file diff --git a/src/PHPDraft/Out/HTML/material/main.twig b/src/PHPDraft/Out/HTML/material/main.twig index 39892435..4891e560 100644 --- a/src/PHPDraft/Out/HTML/material/main.twig +++ b/src/PHPDraft/Out/HTML/material/main.twig @@ -4,9 +4,9 @@ {{ data.TITLE }} - - + + {% for style in css %} {% endfor %} @@ -81,10 +81,10 @@ {% endfor %} - - - - + + + + \ No newline at end of file diff --git a/src/PHPDraft/Out/Tests/TemplateRendererTest.php b/src/PHPDraft/Out/Tests/TemplateRendererTest.php index f021af65..2b99068d 100644 --- a/src/PHPDraft/Out/Tests/TemplateRendererTest.php +++ b/src/PHPDraft/Out/Tests/TemplateRendererTest.php @@ -205,6 +205,7 @@ public function testGetTemplateFailsEmpty(): void { /** * @covers \PHPDraft\Out\TemplateRenderer::get + * @group twig */ public function testGetTemplate(): void { $json = '{"content": [{"content": "hello"}]}'; @@ -214,6 +215,7 @@ public function testGetTemplate(): void { /** * @covers \PHPDraft\Out\TemplateRenderer::get + * @group twig */ public function testGetTemplateSorting(): void { $this->set_reflection_property_value('sorting', 3); @@ -224,6 +226,7 @@ public function testGetTemplateSorting(): void { /** * @covers \PHPDraft\Out\TemplateRenderer::get + * @group twig */ public function testGetTemplateMetaData(): void { $this->set_reflection_property_value('sorting', 3); @@ -241,6 +244,7 @@ public function testGetTemplateMetaData(): void { /** * @covers \PHPDraft\Out\TemplateRenderer::get + * @group twig */ public function testGetTemplateCategories(): void { $this->set_reflection_property_value('sorting', 3); diff --git a/src/PHPDraft/Out/Tests/TwigFactoryTest.php b/src/PHPDraft/Out/Tests/TwigFactoryTest.php index 3d5b73f8..2fbc6c01 100644 --- a/src/PHPDraft/Out/Tests/TwigFactoryTest.php +++ b/src/PHPDraft/Out/Tests/TwigFactoryTest.php @@ -13,6 +13,7 @@ class TwigFactoryTest extends LunrBaseTest * Check factory * * @covers \PHPDraft\Out\TwigFactory::get + * @group twig */ public function testFactory(): void { diff --git a/src/PHPDraft/Out/TwigFactory.php b/src/PHPDraft/Out/TwigFactory.php index 063974c8..ac800a39 100644 --- a/src/PHPDraft/Out/TwigFactory.php +++ b/src/PHPDraft/Out/TwigFactory.php @@ -1,9 +1,7 @@ - - - + + +
-

- -

+

+
+ +
@@ -40,10 +41,10 @@ - - - - + + + + diff --git a/tests/statics/drafter/html/basic.html b/tests/statics/drafter/html/basic.html index 62785036..97f800b7 100644 --- a/tests/statics/drafter/html/basic.html +++ b/tests/statics/drafter/html/basic.html @@ -4,17 +4,18 @@ Tesla Model S JSON API - - - + + +
-

Tesla Model S JSON API - https://owner-api.teslamotors.com -

+

Tesla Model S JSON API

+
+ +

This is unofficial documentation of the Tesla Model S JSON API used by the iOS and Android apps. It features functionality to monitor and control the Model S remotely.

@@ -319,7 +320,12 @@
Example URI
Request object
-
grant_typestring The type of oAuth grant. Always "password"password
client_idstring The oAuth client IDabc
client_secretstring The oAuth client secret123
emailstring The email for my.teslamotors.comelon@teslamotors.com
passwordstring The password for my.teslamotors.comedisonsux
+
grant_typestring

The type of oAuth grant. Always "password"

+
password
client_idstring

The oAuth client ID

+
abc
client_secretstring

The oAuth client secret

+
123
emailstring

The email for my.teslamotors.com

+
elon@teslamotors.com
passwordstring

The password for my.teslamotors.com

+
edisonsux
@@ -490,7 +496,8 @@
URI Parameters
- +
keytypestatusdescriptionvalue
vehicle_idstring requiredThe id of the Vehicle.1
vehicle_idstring required

The id of the Vehicle.

+
1
@@ -553,7 +560,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
@@ -656,7 +664,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
@@ -778,7 +787,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
@@ -890,7 +900,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
@@ -1000,7 +1011,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
@@ -1109,7 +1121,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1242,7 +1255,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1360,13 +1374,16 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
Request object
-
onboolean Whether to enable or disable valet mode.true
passwordnumber (optional) A 4 digit PIN code to unlock the car.1234
+
onboolean

Whether to enable or disable valet mode.

+
true
passwordnumber

(optional) A 4 digit PIN code to unlock the car.

+
1234
@@ -1479,7 +1496,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1594,7 +1612,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1709,7 +1728,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1824,7 +1844,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1939,7 +1960,9 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1limit_valuestring requiredThe percentage value75 + vehicle_idstring required

The id of the Vehicle.

+1limit_valuestring required

The percentage value

+75 @@ -2054,7 +2077,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2169,7 +2193,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2284,7 +2309,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2399,7 +2425,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2514,7 +2541,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2629,7 +2657,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2744,7 +2773,10 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1driver_degCstring requiredThe desired temperature on the driver's side in °C.23.7pass_degCstring requiredThe desired temperature on the passenger's side in °C.18.1 + vehicle_idstring required

The id of the Vehicle.

+1driver_degCstring required

The desired temperature on the driver's side in °C.

+23.7pass_degCstring required

The desired temperature on the passenger's side in °C.

+18.1 @@ -2859,7 +2891,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2974,7 +3007,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -3089,9 +3123,11 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1stateenum required -The desired state of the panoramic roof. The approximate percent open values for each state are `open` = 100%, `close` = 0%, `comfort` = 80%, and `vent` = ~15% -
openenum
percentstring optionalThe percentage to move the roof to.50 + vehicle_idstring required

The id of the Vehicle.

+1stateenum required

The desired state of the panoramic roof. The approximate percent open values for each state are open = 100%, close = 0%, comfort = 80%, and vent = ~15%

+
openenum +
percentstring optional

The percentage to move the roof to.

+50 @@ -3206,7 +3242,9 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1passwordstring requiredThe password to the authenticated my.teslamotors.com account.edisonsux + vehicle_idstring required

The id of the Vehicle.

+1passwordstring required

The password to the authenticated my.teslamotors.com account.

+edisonsux @@ -3321,13 +3359,15 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
Request object
-
which_trunkstring The trunk to open. `rear` is the only one known currently.rear
+
which_trunkstring

The trunk to open. rear is the only one known currently.

+
rear
@@ -3385,10 +3425,10 @@
Headers
- - - - + + + + diff --git a/tests/statics/drafter/html/material.html b/tests/statics/drafter/html/material.html index 54a7b632..5f2f3405 100644 --- a/tests/statics/drafter/html/material.html +++ b/tests/statics/drafter/html/material.html @@ -4,9 +4,9 @@ Tesla Model S JSON API - - + + @@ -265,7 +265,12 @@
Example URI
Request object
-
grant_typestring The type of oAuth grant. Always "password"password
client_idstring The oAuth client IDabc
client_secretstring The oAuth client secret123
emailstring The email for my.teslamotors.comelon@teslamotors.com
passwordstring The password for my.teslamotors.comedisonsux
+
grant_typestring

The type of oAuth grant. Always "password"

+
password
client_idstring

The oAuth client ID

+
abc
client_secretstring

The oAuth client secret

+
123
emailstring

The email for my.teslamotors.com

+
elon@teslamotors.com
passwordstring

The password for my.teslamotors.com

+
edisonsux
@@ -442,7 +447,8 @@
URI Parameters
- +
keytypestatusdescriptionvalue
vehicle_idstring requiredThe id of the Vehicle.1
vehicle_idstring required

The id of the Vehicle.

+
1
@@ -505,7 +511,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -611,7 +618,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -736,7 +744,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -851,7 +860,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -964,7 +974,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1076,7 +1087,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1212,7 +1224,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1333,13 +1346,16 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
Request object
-
onboolean Whether to enable or disable valet mode.true
passwordnumber (optional) A 4 digit PIN code to unlock the car.1234
+
onboolean

Whether to enable or disable valet mode.

+
true
passwordnumber

(optional) A 4 digit PIN code to unlock the car.

+
1234
@@ -1455,7 +1471,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1573,7 +1590,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1691,7 +1709,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1809,7 +1828,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -1927,7 +1947,9 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1limit_valuestring requiredThe percentage value75 + vehicle_idstring required

The id of the Vehicle.

+1limit_valuestring required

The percentage value

+75 @@ -2045,7 +2067,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2163,7 +2186,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2281,7 +2305,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2399,7 +2424,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2517,7 +2543,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2635,7 +2662,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2753,7 +2781,10 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1driver_degCstring requiredThe desired temperature on the driver's side in °C.23.7pass_degCstring requiredThe desired temperature on the passenger's side in °C.18.1 + vehicle_idstring required

The id of the Vehicle.

+1driver_degCstring required

The desired temperature on the driver's side in °C.

+23.7pass_degCstring required

The desired temperature on the passenger's side in °C.

+18.1 @@ -2871,7 +2902,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -2989,7 +3021,8 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1 @@ -3107,9 +3140,11 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1stateenum required -The desired state of the panoramic roof. The approximate percent open values for each state are `open` = 100%, `close` = 0%, `comfort` = 80%, and `vent` = ~15% -
openenum
percentstring optionalThe percentage to move the roof to.50 + vehicle_idstring required

The id of the Vehicle.

+1stateenum required

The desired state of the panoramic roof. The approximate percent open values for each state are open = 100%, close = 0%, comfort = 80%, and vent = ~15%

+
openenum +
percentstring optional

The percentage to move the roof to.

+50 @@ -3227,7 +3262,9 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1passwordstring requiredThe password to the authenticated my.teslamotors.com account.edisonsux + vehicle_idstring required

The id of the Vehicle.

+1passwordstring required

The password to the authenticated my.teslamotors.com account.

+edisonsux @@ -3345,13 +3382,15 @@
URI Parameters
- vehicle_idstring requiredThe id of the Vehicle.1 + vehicle_idstring required

The id of the Vehicle.

+1
Request object
-
which_trunkstring The trunk to open. `rear` is the only one known currently.rear
+
which_trunkstring

The trunk to open. rear is the only one known currently.

+
rear
@@ -3418,10 +3457,10 @@
API Metadata:
- - - - + + + + - - - + + + + diff --git a/tests/statics/full_html_template b/tests/statics/full_html_template index ceb0e3ec..f01ff278 100644 --- a/tests/statics/full_html_template +++ b/tests/statics/full_html_template @@ -4,17 +4,18 @@ - - - + + +
-

- -

+

+
+ +

desc

@@ -43,10 +44,10 @@ - - - - + + + + diff --git a/tests/statics/full_test.apib b/tests/statics/full_test.apib index c663305a..aca8a5a4 100644 --- a/tests/statics/full_test.apib +++ b/tests/statics/full_test.apib @@ -1,5 +1,6 @@ FORMAT: 1A HOST: https://alpha-api.app.net +ALT_HOST: https://acc.alpha-api.app.net, https://alpha-api.app.net EXTRA_HOST: https://test.alpha-api.app.net # Real World API @@ -12,6 +13,11 @@ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia NOTE: This document is a **work in progress**. +|Header1 |Header2 | Header3| +--- | --- | --- +|data1|data2|data3| +|data11|data12|data13| + # Group Posts This section groups App.net post resources. @@ -21,7 +27,7 @@ rich text and annotations which comprise all of the content a users sees in their feed. Posts are closely tied to the follow graph... + Parameters - + post_id: `1` (string, optional) - The id of the Post. + + post_id: `1` (string, optional) - The [id](#id) of the Post. + Default: 2 + Model (application/json)