In a Spring Boot project, when the OpenAPI spec (spec YAML) is provided, use this spec to generate the code for APIs and DTOs rather that building the REST APIs and DTOs at first and then generating spec for them.
Created a sample POC using Spring Boot (a maven project) to consume a sample OpenAPI YAML spec to generate the REST APIs and DTOs.