Skip to content

Commit

Permalink
feat: yaml oas support, fix for lowercase singular
Browse files Browse the repository at this point in the history
Adding yaml support for OAS - this faciliates the aepc
examples usage in the aep.dev site.

Adding some missing parameters in the list API for 
OAS.
  • Loading branch information
toumorokoshi committed Oct 23, 2024
1 parent 691707b commit f563f82
Show file tree
Hide file tree
Showing 11 changed files with 1,130 additions and 872 deletions.
12 changes: 11 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func ProcessInput(inputFile, outputFilePrefix string) error {
return fmt.Errorf("error parsing service: %w", err)
}
proto, err := proto.WriteServiceToProto(ps, outputDir)
if(err != nil) {
if err != nil {
return fmt.Errorf("error writing service proto %w", err)
}
protoFile := fmt.Sprintf("%s.proto", outputFilePrefix)
Expand All @@ -93,6 +93,16 @@ func ProcessInput(inputFile, outputFilePrefix string) error {
return fmt.Errorf("error writing file: %w", err)
}
fmt.Printf("output openapi file: %s\n", openapiFile)
yamlOpenAPI, err := yaml.JSONToYAML(openapi)
if err != nil {
return fmt.Errorf("error converting openapi json to yaml: %w", err)
}
yamlOpenAPIFile := fmt.Sprintf("%s_openapi.yaml", outputFilePrefix)
err = WriteFile(yamlOpenAPIFile, yamlOpenAPI)
if err != nil {
return fmt.Errorf("error writing yaml file: %w", err)
}
fmt.Printf("output openapi yaml file: %s\n", yamlOpenAPIFile)
return nil
}

Expand Down
Loading

0 comments on commit f563f82

Please sign in to comment.