Skip to content

Add support to configure packages-to-scan as list using YAML Syntax #376

Closed
@pieterdegraeuwe

Description

@pieterdegraeuwe

I am not able to use packages-to-scan nor paths-to-match. using one package or one path does work.
However, from the moment I want a list of more than one element it resolves in just one list with one element, of null:

`springdoc :
packages-to-scan :

  • val1
  • val2
    (the dots are dashes, escaping them in markdown does not seem to work)
    `

springdoc : packages-to-scan : some.package
Gives a list, with one element. (so this seems to work als long as you need only one package/path)

springdoc : packages-to-scan : some.package, some.secondpackage
does resolve in a list with one element ; "some.package, some.secondpackage', which is of course not the result we want.

Looking to the code, I think that it just cannot work. It is used as a simple @value(SPRINGDOC_PACKAGES_TO_SCAN) inside the AbstractOpenApiResource, while (I think) those lists only work in ConfigurationProperties.

Easy to reproduce: add
@Value(SPRINGDOC_PACKAGES_TO_SCAN) private List<String> packagesToScan;
in the test AbstractSpringDocTest. and add some packages to the application-test.yml

Any hints how to get around this? (or am I missing something?)
Thanks

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