Hi,
I wanted to report that the first application code in the Getting Started page in the reference doc lacks imports, which prevent the first application to get packaged and runned successfully:
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
As a beginner, I lost some time figuring out why my application could not build, and I guess other beginners will struggle.
I see in this repo that there is a corresponding snippet here, which does contain the imports: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/gettingstarted/firstapplication/code/MyApplication.java
No idea why the imports don't end up in the code snippet as displayed in the getting started page.
Comment From: wilkinsona
The imports are hidden to reduce the visual noise. If you click on the "Expand" button in the bottom-right corner they will be shown. There's also a "Copy to clipboard" button that will copy all the text, including the imports, to your clipboard irrespective of whether or not the text has been expanded.