Currently looking into the possible solutions to use the OAS/yaml file present in s3 to be used as the input to the code generator swagger code gen maven plugin tag. When the object Url of the OAS which is stored in s3 is used there is a error encountered 403 forbidden error. Looking into ways this can be resolved.
<plugins>
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.4.21</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>https://s3creation1.s3.amazonaws.com/PartyManagementOpenAPI+(1).yaml</inputSpec>
<language>spring</language>
<generateSupportingFiles>true</generateSupportingFiles>
<!-- <supportingFilesToGenerate>Configuration.java,indexhadler.java</supportingFilesToGenerate>
-->
<configOptions>
<sourceFolder>src/main/java/</sourceFolder>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
When the above mentioned location of the inputspec is used, during the build the following error is encountered.
--- swagger-codegen-maven-plugin:2.4.21:generate (default) @ demo ---
[INFO] reading from https://s3creation1.s3.amazonaws.com/PartyManagementOpenAPI+(1).yaml
[ERROR] unable to read
java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3creation1.s3.amazonaws.com/PartyManagementOpenAPI+(1).yaml
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
When the location of the <inputspec> is changed to a location of a local file the swagger-codegen works fine.
Looking for any suggesstions.