2015-03-31 26 views
0

我在我的團隊中遇到了這個問題。Swagger和Play框架 - 使用活頁夾

使用播放框架,我已經定義了這條路線:

GET /profiles/:profile/emails @controllers.Emails.indexByProfileId(profile: Long, page: Int ?= 1, pagesize: Int ?= 25) 

我用招搖記錄的路線:

def indexByProfileId(
    @ApiParam(value = "Profile id", required = true) @PathParam("profileId") 
    profileId: Long, 
    @ApiParam(value = "Page number", required = false) @PathParam("page") 
    page: Int, 
    @ApiParam(value = "Page size", required = false) @PathParam("pageSize") 
    pageSize: Int) = ... 

一切運作良好。但是,當我嘗試爲頁面頁面大小定義活頁夾時,Swagger不再有效。如果我禁用Swagger,活頁夾就可以工作。這是一個拋出的異常:

Problem loading class: controllers.Emails.indexByProfileId(profile:com.pure360.db.Id, page:dto.PaginationDTO ?= dto. java 
.lang.ClassNotFoundException: class controllers.Emails.indexByProfileId(profile:com.pure360.db.Id, page:dto.PaginationDTO ?= dto not found 

我假定該揚鞭是困惑,因爲路線共定義了3個參數,但現在終端定義粘結劑的只有2個,因爲。有沒有讓Swagger知道這件事的方法?

謝謝

回答

1

請打開票swagger-core。 Play框架的支持正在被重寫,我們可以確保這個用例有很好的文檔記錄。