1
votes


I'm using OpenAPI to Document a Microprofile application. As the Endpoint contains a large set of methods, I'd like to know if it's possible to filter through the /openapi REST, so that it returns just a specific Path, for example "/users". Thanks

2

2 Answers

1
votes

You can have multiple paths selected. In openapi file the whole path section is called "paths" (so even the name is plural). If you're not sure how to use it, walk through openapi's in the "search" section of Swagger portal (you need to be logged in for this).

Example:

paths: 
  /{users}:
    options:
      security:
      summary: "Temp summary"
      description: "Temp description"
      tags: 
        - "TAG"
      parameters:
..
  /test/{table}:
    options:
      security:
      summary: "Temp summary"
      description: "Temp description"
      tags: 
        - "TAG"
      parameters:
..
  /test2/user/{id}:
    options:
      security:
      summary: "Temp summary"
      description: "Temp description"
      tags: 
        - "TAG"
      parameters:
0
votes

as per our use case we found this to be working.

Annotate your endpoint with @Operation and add a hidden = true parameter to the annotation.

Here in Kotlin:

    @GET @Path("/{id}")
    @Operation(
        summary = "your summary",
        hidden = true
    )
    fun getDataset(@RestPath id: String): Response {
        ....
    }