簡體   English   中英

Swagger Laravel 5-[語義錯誤]找不到常量名稱

[英]Swagger Laravel 5 - [Semantical Error] Couldn't find constant name

任何人都可以幫助清除此錯誤嗎? 我正在為Laravel使用latrell \\ swagger,並且已經在我的一個模型中定義了它:

use Swagger\Annotations as SWG;

/**
 * @SWG\Parameter(
 *      partial="body_recipienttag",
 *      name="body",
 *      description="Recipient Tag to be created",
 *      type="RecipientTag",
 *      paramType="body",
 *      required=true,
 *      allowMultiple=false
 * )
 * @SWG\Model(id="RecipientTag")
 *
 * @SWG\Property(name="id",type="integer",format="int64",description="Unique identifier for the recipient tag")
 * @SWG\Property(name="name", type="string", description="The name of this recipient tag")
 * @SWG\Property(name="recipient_tag_group_id", type="integer", format="int64", description="The recipient tag group id this tag belongs to")
 * @SWG\Property(name="location_id", type="integer", format="int64", description="The location id this tag belongs to")
 * @SWG\Property(name-"location_group_id", type="integer", format="int64, description="The location group id this tag belongs to")
 * @SWG\Property(name="created_at",type="string",format="date-format",description="Date this interaction was created")
 * @SWG\Property(name="deleted_at",type="string",format="date-format",description="Date this interaction was deleted")
 * @SWG\Property(name="updated_at",type="string",format="date-format",description="Date this interaction was last updated")
 */
class RecipientTag extends Model {

但是,當我去構建文檔時,它返回以下內容:

vagrant@homestead:~/Code$ php /home/vagrant/Code/vendor/zircote/swagger-php/swagger.phar app -o public/apidocs
Swagger-PHP 1.0.0
-----------------
[WARN] [Semantical Error] Couldn't find constant name, /home/vagrant/Code/app/Api/Tags/Recipient/RecipientTag.php on line 8.
[INFO] Partial "body_recipienttag" not found.
[INFO] Partial "body_recipienttag" not found.
Created public/apidocs/api-docs.json
Skipped public/apidocs/index.php
Created public/apidocs/as_testing.json
Created public/apidocs/closedloop.json
Created public/apidocs/interactions.json
Created public/apidocs/interactiontype.json
Created public/apidocs/location.json
Created public/apidocs/steps.json
Created public/apidocs/tag_recipient.json

有誰知道我該如何解決? 我有其他模型(除了名稱/變量等)是相同的,它們很好。 我已經檢查過Google,沒有任何有用的信息報告。 我只是要檢查來源並找出答案,但與此同時我想問一下。

干杯。

暫停了 有幾個問題:

* @SWG\Property(name-"location_group_id", type="integer", format="int64, description...

首先name=不正確,最后我錯過了format字段中的引號。

一些稍微更好的錯誤響應會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM