zalando/logbook

Unresolvable Spring properties

piotrooo opened this issue · 10 comments

Detailed Description

IntelliJ reports an unresolvable property.

Context

Currently IntelliJ cannot suggest available properties. They works, but IntelliJ shows errors:

Screenshot from 2023-07-10 10-41-20

Auto-completion of the properties provided by a Spring module, could be a really good developer experience.

Possible Implementation

Metadata spring-configuration-metadata.json should be generated instead of additional-spring-configuration-metadata.json.

Your Environment

  • Version used: 3.1.0

Hi @piotrooo

The property you want to use is logbook.minimum-status, not logbook.status-at-least, see relevant section in readme and the LogbookAutoConfiguration class.

Thanks for tip, that was missclick. But that in fact is a reason of this feature/fix. If my IDE suggest me correct values (based on e.g. LogbookProperties) that kind of errors will disappear. It's gives a better developer experience.

For this property I'm getting the hint from IntelliJ
image

I'm using IntelliJ IDEA 2023.1.3 (Ultimate Edition) Build #IU-231.9161.38, built on June 20, 2023

Are you getting hints for other properties of logbook, but not this one?

Yes, I have suggestions from the other projects.
I using application.properties, maybe this is a reason?

Could you check if it's still reproducible? I can also see the hints in application.properties file
image

Yes, I still have this issue. It's super weird... All properties (from 3rd party libs and from the project) are working. There is only problem with logbook 😢

A little bit info about my setup:

  • Java
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)
  • Spring Boot 3.1.2
  • Logbook 3.2.0
  • Ubuntu 22.04.2 LTS

The only difference that I have noticed in comparison with other libs is file in a META-INF additional-spring-configuration-metadata.json for logbook and spring-configuration-metadata.json for other libs.

Screenshot from 2023-07-26 08-20-37

Screenshot from 2023-07-26 08-21-08

Both additional-spring-configuration-metadata.json and spring-configuration-metadata.json should have worked. Maybe something to do with the annotationProcessor as described in 3.1. Configuring the Annotation Processor.
Alternatively, could you run a small experiment? Rename additional-spring-configuration-metadata.json to spring-configuration-metadata.json, run mvn install locally and try using the 3.4.0-SNAPSHOT version. To verify if it's something to do with the metadata being defined in another type of the file

dx1ngy commented

The same issue, I changed the file "additional-spring-configuration-metadata.json" to "spring-configuration-metadata.json," and the problem was resolved.
image

This should be resolved in the next release (3.5.0). Please re-open this issue if the problem is not fully addressed

I can confirm that fix solved the problem for me.