-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consistent pagination experience across all APIs (#86)
# Goal: present consistent entity listing for the end-user Only 30% of APIs have pagination, though there are two different implementations of it. This PR proposes generating wrapper methods to return consistent type for a collection of all results. It also adds frequently used wrappers, like name-to-id mapping, which could later be used to generate client-level upserts. Decisions to discuss: ## Return type: slice vs iterator * Current implementation proposes returning slice + error * theoretically, with added complexity, we can move to iterator + error implementation, though Go ecosystem didn't settle on the standard iterator yet: golang/go#54245 * other ecosystems, like Python, Java, and JavaScript should lean towards iterators ## Naming: ListQueriesAll (suffix) vs ListAllQueries (infix) vs all methods returning slices (might be invasive) * current template has "All" name suffix for methods returning all results * 18% of APIs return slice from the platform. * 36% of APIs return all results, but in a single-field response. ### Out of scope of this PR * splitting high-level generated interface from low-level direct mapping #87 * telemetry for higher-level generated code #88
- Loading branch information
Showing
55 changed files
with
1,678 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ vendor/ | |
coverage.txt | ||
|
||
.vscode/*.lograw-specs/** | ||
.vscode/*.log | ||
|
||
raw-specs/** | ||
out/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.