Replies: 1 comment
-
|
I believe (Aside: Personally, I find this somewhat problematic, since it makes error handling on the client side more difficult. If the schema keeps evolving, documenting an error response in the OpenAPI spec changes how a client needs to handle errors... Checking for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First, my hands thank the Maintainers for handling this boilerplate! Second, I ran
ogenon the Pinterest spec and it generated 116 client methods as expected. However, 93 of them return a*Res interface, while 23 of them return a pointer*...OK struct. Moreover, one of the methods returning an (unexpected) pointer*...OK structworks correctly, while another method returning an (expected)...Res interfacefails with:Here's my code:
The very first call to
client.AdAccountsList(ctx, api.AdAccountsListParams{})works correctly, along with the followingforranging overres.GetItems(). However, the call toclient.CampaignsList(ctx, params)returns the expectedCampaignsListRes interface, but then the secondforfails because there's noGetItems()method onCampaignsListRes.The documentation on Interface responses only has the
...Res interface, so why doesclient.AdAccountsList(ctx, api.AdAccountsListParams{})return*AdAccountsListOK?Here's the generated methods:
Here's my
ogen.yml:Finally, below is the relevant yaml from the Pinterest spec, but I had to fix 5 schema errors (2 excess indentations on
minItems; 2 incorrect instances ofstringtype that should beobjecttype; and 1 incorrect usage ofmaxLengthwhich should bemaxItems).Any help is appreciated! 🙏
Beta Was this translation helpful? Give feedback.
All reactions