簡體   English   中英

Swagger and Play Framework-使用活頁夾

[英]Swagger and Play Framework - using binders

我的團隊中有這個問題。

使用Play Framework,我定義了以下路線:

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) = ...

一切正常。 但是,當我嘗試為pagepageSize定義活夾時,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

我猜想Swagger是混亂的,因為路由總共定義了3個參數,但是由於綁定器,端點現在僅定義了2個。 有沒有辦法讓Swagger知道這一點?

謝謝

請在swagger-core上打開一張票。 Play框架支持正在被重寫,我們可以確保對此用例進行了充分的文檔記錄。

暫無
暫無

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

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