Coder Social home page Coder Social logo

Comments (1)

Javakky-pxv avatar Javakky-pxv commented on May 23, 2024

@nVitius
Perhaps the following features might be available.

How to hide an endpoint?

If you don't want an end point to be included, add ### NoDocs ### in front of it e.g.

### NoDocs ###
GET   /docs/swagger-ui/*file        controllers.Assets.at(path:String="/public/lib/swagger-ui", file:String)

Skip entire file

The entire file can be skipped by adding ### SkipFileForDocs ### at the beginning of the routes file.

Alternatively, the routes file can be split into multiple files, so that you can skip practically only a part of the file.

https://www.playframework.com/documentation/ja/2.4.x/SBTSubProjects

### SkipFileForDocs ###

GET      /api/hidden/a                 controllers.hiddenEndPointA()
GET      /api/hidden/b                 controllers.hiddenEndPointB()
GET      /api/hidden/c                 controllers.hiddenEndPointC()

It may also be possible to create a feature here to skip blank comments in the SwaggerSpecGenerator.

private def endPointEntry(route: Route, prefix: String, tag: Option[String]): Option[(String, JsObject)] = {
import SwaggerSpecGenerator.marker
val comments = route.comments.map(_.comment).mkString("\n")
if (s"$marker\\s*NoDocs\\s*$marker".r.findFirstIn(comments).isDefined) {
None
} else {
val inRoutePath = route.path.parts.map {
case DynamicPart(name, _, _) => s"{$name}"
case StaticPart(value) => value
}.mkString
val method = route.verb.value.toLowerCase
Some(fullPath(prefix, inRoutePath) -> Json.obj(method -> endPointSpec(route, tag)))
}
}

Sorry for the brief answer, but if you have any questions, please feel free to ask again.

from play-swagger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.