Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Apr 7, 2022
1 parent e4efff7 commit 483e13c
Show file tree
Hide file tree
Showing 3 changed files with 245 additions and 20 deletions.
8 changes: 3 additions & 5 deletions generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,7 @@ func writeMethod(doc *openapi3.T, f *os.File, method string, path string, o *ope
if pageResult && !isGetAllPages {
// Run the method again with get all pages.
// Skip doing all pages for now.
// TODO: make all pages work.
// writeMethod(doc, f, method, path, o, true)
writeMethod(doc, f, method, path, o, true)
}
}

Expand Down Expand Up @@ -773,9 +772,8 @@ func getSuccessResponseType(o *openapi3.Operation, isGetAllPages bool) (string,
getAllPagesType := ""
if isGetAllPages {

items := content.Schema.Value.Items
if items != nil {
getAllPagesType = fmt.Sprintf("[]%s", printType("", items))
if items, ok := content.Schema.Value.Properties["items"]; ok {
getAllPagesType = printType("", items)
} else {
fmt.Printf("[WARN] TODO: skipping response for %q, since it is a get all pages response and has no `items` property:\n%#v\n", o.OperationID, content.Schema.Value.Properties)
}
Expand Down
241 changes: 234 additions & 7 deletions paths.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 483e13c

Please sign in to comment.