Skip to content

Support for @Operation in @RepositoryRestResource Spring Data Repositories #1026

Closed
@MarcelBruch

Description

@MarcelBruch

I've a MongoRepository similar to the one below. I wasn't able to set

@RepositoryRestResource(path = "contacts")
interface JavaCompletionSessionRepository : MongoRepository<Contact, String> {

    @Operation(summary = "Find an existing contact", description = "", tags = ["contacts"], operationId="someId")
    //@RouterOperation(operation = Operation(summary = "Find an existing contact", description = "", tags = ["contacts"]))
    @ApiResponses(
        value = [
            ApiResponse(responseCode = "200", description = "successful operation"),
            ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
            ApiResponse(responseCode = "404", description = "Contact not found"),
            ApiResponse(responseCode = "405", description = "Validation exception")]
    )
    fun findByUserId(@Param("userId") userId: String): List<Contact>

It seems that Springdoc is not picking up any information about here (just some unsatisfying defaults)?

This is particular ugly since I'm generating a client from the generated OpenAPI and the defaults lead to bad method names there.

Could this feature be added - or is there a reasonable workaround for this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions