-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
In the API specs, there are several operations that have the Namely:
This is something that could be checked automatically when creating new api doc. In naive code: for p in paths:
if "Page" in p.get.params:
assert("meta" in p.get.response.schema) |
@sbhatnagar-equinix take a look at @t0mk's comment above; he has a good suggestion in there to proactively catch missing properties for paginated endpoints. |
@ctreatma @displague Another iteration of the pagination code generation. This time I managed to actually do a paginated call in go, using the generated code from the new template. I updated the pytohn script to add also the property name, you can see it I updated the template so that it uses the property and so that the code actually works: Example of generated code: |
Make the prefix |
cf9dc3a
to
ccb3914
Compare
@ctreatma @displague I rebased and cleaned this PR. You can see the gradual changes in the commits added today (25-09-2023). It's big but quite structured. I didn't have to do any change to the Makefile 🤔 This is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
I left some nitpics about generated function comments and documentation. I'd prefer for those to land in this merge, but open to follow-ups.
Some thoughts on the vendoring:
- I think we may want to use an
x-equinix-metal-
prefix. - I don't know that we need to nest the
x-paginated
andx-paginated-property
, it could be just the latter, flat (I think)
Since these are only used internally, we can rename them in this project at any time (not merge blocking).
@displague I will include your suggestions in this PR. I will also change the property name to |
Co-authored-by: Marques Johansson <mjohansson@equinix.com> Signed-off-by: Tomáš Karásek <t0mk@users.noreply.github.com>
@displague all changes done
Please review again. |
This PR is included in version 0.23.0 🎉 |
This PR adds logic for generating listing functions capable of going through all the pages (think devices in a project, or events in a device).
It adds templates for the new code, docs, and code tests. The templates are fetched from oag v7.0.0, and then modified for the sake of the paginated listers.
It uses vendor extension property object in the form
The spec patching part can be done in other oag generated SDKs.
related to #135
fixes #131