aptly icon indicating copy to clipboard operation
aptly copied to clipboard

API Docs returns types not entirely correct

Open chesseed opened this issue 3 months ago • 1 comments

I've been writing an API client and I've been biten multiple times by the docs of the return types. So I'd like to improve the documentation. But beforehand I want to know how handle things.

There are two types of differences between the docs and the implementation:

  1. The names in the docs are lowercase, in the implementation uppercase
  2. The docs specify members, that are internal and should not be exposed

In many cases it should be enough to add the missing json struct tags e.g deb.Snapshot or deb.LocalRepo

But deb.PublishedRepo is different. The MarshalJSON creates an anonymous intermediate struct with a different Sources type. So to properly document it the anonymous struct should be made in a concrete type, right?

Is there anything I'm missing or some reason against improving the docs this way?

chesseed avatar Oct 09 '25 20:10 chesseed

Yes, all returned structures should be a documented type, not just json. Thanks for spotting this !

neolynx avatar Nov 08 '25 12:11 neolynx