Skip to content

Commit

Permalink
Merge pull request #324 from james2doyle/feature/field-examples
Browse files Browse the repository at this point in the history
Feature/field examples. Closes #322
  • Loading branch information
shalvah authored Sep 29, 2021
2 parents c1da197 + 4668014 commit e4d7e17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion resources/views/components/body-parameters.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'type' => $subfield['type'] ?? 'string',
'required' => $subfield['required'] ?? false,
'description' => $subfield['description'] ?? '',
'example' => $subfield['example'] ?? '',
'endpointId' => $endpointId,
'hasChildren' => false,
'component' => 'body',
Expand Down Expand Up @@ -53,6 +54,7 @@
'type' => $subfield['type'] ?? 'string',
'required' => $subfield['required'] ?? false,
'description' => $subfield['description'] ?? '',
'example' => $subfield['example'] ?? '',
'endpointId' => $endpointId,
'hasChildren' => false,
'component' => 'body',
Expand All @@ -70,6 +72,7 @@
'type' => $parameter['type'] ?? 'string',
'required' => $parameter['required'] ?? false,
'description' => $parameter['description'] ?? '',
'example' => $parameter['example'] ?? '',
'endpointId' => $endpointId,
'hasChildren' => false,
'component' => 'body',
Expand All @@ -78,4 +81,3 @@
</p>
@endif
@endforeach

3 changes: 2 additions & 1 deletion resources/views/components/field-details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@
<input type="{{ $inputType }}"
name="{{ $fullName }}"
data-endpoint="{{ $endpointId }}"
value="{{ $example }}"
data-component="{{ $component }}" @if($required)required @endif hidden>
@endif
@endif
<br>
{!! Parsedown::instance()->text($description) !!}
{!! Parsedown::instance()->text($description) !!}
2 changes: 2 additions & 0 deletions resources/views/themes/default/endpoint.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
'type' => $parameter->type ?? 'string',
'required' => $parameter->required,
'description' => $parameter->description,
'example' => $parameter->example ?? '',
'endpointId' => $endpoint->endpointId(),
'component' => 'url',
])
Expand All @@ -127,6 +128,7 @@
'type' => $parameter->type,
'required' => $parameter->required,
'description' => $parameter->description,
'example' => $parameter->example ?? '',
'endpointId' => $endpoint->endpointId(),
'component' => 'query',
])
Expand Down

0 comments on commit e4d7e17

Please sign in to comment.