Skip to content

Support dynamic evaluation of description field in the RequestBody annotation #2488

Closed
@kbos-work

Description

@kbos-work

Is your feature request related to a problem? Please describe.

While using the @RequestBody annotation it doesn't replace variable content ${myapicall.request_body.description} for the description. Example the following will result in outputting the variable as is inside the swagger doc

@RequestBody(description = "${myapicall.request_body.description}")

Describe the solution you'd like

While using annotations in for example @Operation and @Parameter it supports dynamic evaluation of properties. For example the following will generate the swagger doc in which the summary/descriptions are replaced with the corresponding values from the property file

@Operation(summary = "${myapicall.summary}", description = "${myapicall.description}")
public ResponseEntity<Object> doApiCall(@Parameter(description = "${myapicall.params.example}", required = true) @RequestParam String example) {

}

It would be great if the same would be supported for @RequestBody. Looking deeper in the source it would effectively mean to support the usage of PropertyResolverUtils inside the RequestBodyService similar to GenericParameterService

Describe alternatives you've considered

  • Only real alternative is defining it directly in code, but in case of an multi language setup that would not work

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions