matthiasblaesing commented on issue #8262:
URL: https://github.com/apache/netbeans/issues/8262#issuecomment-2676347496

   I simplified this and (I think) fixed it:
   
   ```diff
   --- a/src/main/java/com/example/generatesources/GenerateSources.java
   +++ b/src/main/java/com/example/generatesources/GenerateSources.java
   @@ -1,17 +1,11 @@
    package com.example.generatesources;
    
   -import com.example.client.domain.PetDTO;
   -import com.example.openapi.client.api.PetApi;
   +import org.openapitools.model.PetDTO;
    
    public class GenerateSources {
    
        public static void main(String[] args) {
   -        MapstructMapper mapper = new MapstructMapperImpl();
   -        mapper.map(new Bar());
   +    new PetDTO();
            System.out.println("Hello World!");
   -        PetApi petApi = new PetApi();
   -        PetDTO petDTO = new PetDTO();
   -        petDTO.setName("Test");
   -        petApi.addPet(petDTO);
        }
    }
   
   ```
   
   - use correct package for DTO files (package of imported class, did not 
match the target package for generator)
   - added my understanding of an expected call for Mapstruct
   - added call to generated api
   
   
   ```diff
   --- a/pom.xml
   +++ b/pom.xml
   @@ -76,29 +76,7 @@
              </configOptions>
            </configuration>-->
            <executions>
   -          <execution>
   -            <id>openapi-server</id>
   -            <goals>
   -              <goal>generate</goal>
   -            </goals>
   -            <configuration>
   -              <generatorName>spring</generatorName>
   -              
<inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec>
   -              <generateSupportingFiles>true</generateSupportingFiles>
   -              <generateApiDocumentation>true</generateApiDocumentation>
   -              <generateModels>true</generateModels>
   -              <generateModelTests>false</generateModelTests>
   -              <generateApiTests>false</generateApiTests>
   -              <modelNameSuffix>DTO</modelNameSuffix>
   -              <output>${project.build.directory}/generated-sources</output>
    
   -              <configOptions>
   -                <sourceFolder>openapi</sourceFolder>
   -                <useJakartaEe>true</useJakartaEe>
   -              </configOptions>
   -            </configuration>
   -          </execution>
   -
              <execution>
                <id>openapi-client</id>
                <goals>
   @@ -111,15 +89,17 @@
                  <library>restclient</library>
                  
<inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec>
                  <generateSupportingFiles>true</generateSupportingFiles>
   -              <generateApiDocumentation>true</generateApiDocumentation>
   +              <generateApiDocumentation>false</generateApiDocumentation>
                  <generateModels>true</generateModels>
                  <generateModelTests>false</generateModelTests>
                  <generateApiTests>false</generateApiTests>
   +              <generateModelDocumentation>false</generateModelDocumentation>
                  <modelNameSuffix>DTO</modelNameSuffix>
   -              <output>${project.build.directory}/generated-sources</output>
   +              
<output>${project.build.directory}/generated-sources/democlient</output>
   +              
<supportingFilesToGenerate>ApiClient.java,Authentication.java,HttpBasicAuth.java,HttpBearerAuth.java,ApiKeyAuth.java,OAuth.java,JavaTimeFormatter.java,RFC3339DateFormat.java</supportingFilesToGenerate>
    
                  <configOptions>
   -                <sourceFolder>openapi</sourceFolder>
   \ No newline at end of file
   +                <sourceFolder>./</sourceFolder>
   \ No newline at end of file
                    <useJakartaEe>true</useJakartaEe>
                  </configOptions>
                </configuration>
   
   ```
   
   - Reduce openapi generated code to only server (I fail to see why you would 
need both parts in the same project).
   - Disable api documentation generation (this only messes up the output 
directory)
   - Disable model documentation generation (this only messes up the output 
directory)
   - Move output of the generation to the right base directory 
(`<project.build.directory>/generated-sources/<per-client-name>`)
   - Ensure sources are put into the root of the output folder
   
   
   Note: For NB25 and lombok read 
https://github.com/apache/netbeans/discussions/8221
   
   Unless more arguments are made, I don't see an issue and will move this to 
discussion.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to