Closed lhw closed 3 years ago
I started doing this for Satellite at https://github.com/umich-vci/gosatellite using go-swagger. The problem I ran into is that the API does not document any of its responses which makes the generated client useless.
I put in an RFE - https://bugzilla.redhat.com/show_bug.cgi?id=1803138
I did some tests initially with go-swagger and pyswagger and as you described only ended up with unusable gibberish. The whole foreman/satellite API is a bit of a mess. It also returns results in an unpredictable manner on some endpoints. The swagger variant was an idea I had. But generally it could be useful to abstract the API out of the project so it could be used elsewhere.
With a few modifications its possible to extract a swagger api definition from foreman. This would be a great base for a golang foreman api library. Which in turn could be used here.