We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"swagger-play2.8" % "3.1.0" did not support @ApiParam(hidden = true) so I implemented parameter hide with SwaggerSpecFilter.
[WARN] SwaggerSpecFilter work only in this swagger-play but not with sbt-swagger-play plugin because of Issue 11.
To use SwaggerSpecFilter to hide parameters:
package filters; import io.swagger.core.filter.AbstractSpecFilter; import io.swagger.model.ApiDescription; import io.swagger.models.Operation; import io.swagger.models.parameters.Parameter; import play.Logger; import java.util.List; import java.util.Map; public class InternalSwaggerFilter extends AbstractSpecFilter { protected final Logger.ALogger logger = Logger.of("swagger"); @Override public boolean isParamAllowed(Parameter parameter, Operation operation, ApiDescription api, Map<String, List<String>> params, Map<String, String> cookies, Map<String, List<String>> headers) { String access = parameter.getAccess(); if ((access != null) && access.equals("hidden")) { logger.debug(String.format("InternalSwaggerFilter:isParamAllowed %s %s parameter:%s access=hidden -> false", operation.getOperationId() ,api.getPath() ,parameter.getName())); return false; } return true; } }
swagger.filter="filters.InternalSwaggerFilter" play.modules.enabled += "play.modules.swagger.SwaggerModule"
@ApiParam(access = "hidden")
Like:
@Api(value = "Base Api", produces = "application/json") public class APIController extends Controller { @Path("/users") @ApiOperation( tags={ "user" }, value = "Get users list." ) public CompletionStage<Result> getUsersList( @ApiParam(access = "hidden") Http.Request request){ return getList(request, User.class); } }
libraryDependencies ++= Seq( // API annotations "io.swagger" % "swagger-annotations" % "1.6.6", "io.swagger" % "swagger-core" % "1.6.6", // The following is only necessary if you're having trouble resolving dependencies "javax.ws.rs" % "jsr311-api" % "1.1.1", "com.github.dwickern" %% "swagger-play2.8" % "3.1.0", "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.11.1" )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
"swagger-play2.8" % "3.1.0" did not support @ApiParam(hidden = true) so I implemented parameter hide with SwaggerSpecFilter.
[WARN] SwaggerSpecFilter work only in this swagger-play but not with sbt-swagger-play plugin because of Issue 11.
To use SwaggerSpecFilter to hide parameters:
@ApiParam(access = "hidden")
to hide parameters you not need.Like:
The text was updated successfully, but these errors were encountered: