11package io .github .venkat1701 ;
22
3- import com .squareup .javapoet .JavaFile ;
4- import com .squareup .javapoet .MethodSpec ;
5- import com .squareup .javapoet .TypeSpec ;
3+ import io .github .venkat1701 .openapi .parser .YAMLParser ;
4+ import io .swagger .v3 .oas .models .Operation ;
5+ import io .swagger .v3 .oas .models .PathItem ;
6+ import io .swagger .v3 .parser .core .models .ParseOptions ;
67
7- import javax .lang .model .element .Modifier ;
88import java .io .IOException ;
9- import java .nio . file . Paths ;
9+ import java .util . Map ;
1010
1111public class Main {
1212 public static void main (String [] args ) throws IOException {
13-
13+ var parser = new YAMLParser ("src/main/resources/openapi.yaml" );
14+ var parseOptions = new ParseOptions ();
15+ parseOptions .setResolve (true );
16+ var result = parser .readLocationWithAuthValue (null , parseOptions );
17+ var openAPI = parser .getOpenAPI ();
18+
19+ // This thing below lists down all the operations required to create the SDK.
20+ // openAPI.getPaths().forEach((path, pathItem) -> {
21+ // Map<PathItem.HttpMethod, Operation> operations = pathItem.readOperationsMap();
22+ // operations.forEach((method, operation) -> System.out.println("Method: "+method + "\nOperation: "+operation));
23+ // });
24+ demoGenerateSources (parser );
25+ }
26+
27+ public static void demoGenerateSources (YAMLParser parser ) throws IOException {
28+ var openApi = parser .getOpenAPI ();
29+
1430 }
1531}
0 commit comments