Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed Apr 18, 2018
1 parent 716c725 commit ec0f4d9
Show file tree
Hide file tree
Showing 8 changed files with 732 additions and 921 deletions.
1 change: 0 additions & 1 deletion app/Console/Commands/CreateEndpointDocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function handle()
$doc .= \App\Models\Collections\Exhibition::instance()->docEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Image::instance()->docEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Video::instance()->docEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Link::instance()->docEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Sound::instance()->docEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Text::instance()->docEndpoints($this->appUrl);

Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/CreateFieldsDocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function handle()
$doc .= \App\Models\Collections\Exhibition::instance()->docFields();
$doc .= \App\Models\Collections\Image::instance()->docFields();
$doc .= \App\Models\Collections\Video::instance()->docFields();
$doc .= \App\Models\Collections\Link::instance()->docFields();
$doc .= \App\Models\Collections\Sound::instance()->docFields();
$doc .= \App\Models\Collections\Text::instance()->docFields();

Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/CreateSwaggerDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public function handle()
$doc .= \App\Models\Collections\Exhibition::instance()->swaggerEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Image::instance()->swaggerEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Video::instance()->swaggerEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Link::instance()->swaggerEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Sound::instance()->swaggerEndpoints($this->appUrl);
$doc .= \App\Models\Collections\Text::instance()->swaggerEndpoints($this->appUrl);

Expand Down
13 changes: 11 additions & 2 deletions app/Models/Documentable.php
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,17 @@ public function swaggerSubresource($subresource, $includeExampleOutput = true)
$doc .= $this->swaggerProduces();
$doc .= $this->swaggerParameters(['id' => 'Resource id to retrieve']);

$subModel = app('Resources')->getModelForEndpoint($subresource);
$doc .= $this->swaggerResponses(class_basename($subModel));
try
{
$subModel = app('Resources')->getModelForEndpoint($subresource);
$doc .= $this->swaggerResponses(class_basename($subModel));
}
catch (\Exception $e)
{
// Fall back to using this model's own response, in cases like `parts` and `sets` where
// the subresource represensts a set of the same models
$doc .= $this->swaggerResponses();
}

$doc .= " }\n";
$doc .= " },\n";
Expand Down
14 changes: 13 additions & 1 deletion app/Models/Mobile/TourStop.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,19 @@ protected function transformMappingInternal()
public function exampleId()
{

return "3245";
return "77";

}

/**
* Whether this resource has a `/search` endpoint
*
* @return boolean
*/
public function hasSearchEndpoint()
{

return false;

}

Expand Down
Loading

0 comments on commit ec0f4d9

Please sign in to comment.