redpanda-data / redpanda

Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
https://redpanda.com
9.71k stars 591 forks source link

Admin API swagger endpoint is returning invalid json #3149

Open jcsp opened 2 years ago

jcsp commented 2 years ago

I think the seastar API helpers are trying to concatenate all our swagger json files to generate one, but this falls over because some of our .json files contain a full API definition rather than just some paths. They do that because they define models.

Point a client at http://server:9644/v1 to see it.

JIRA Link: CORE-791

jcsp commented 2 years ago

Hmm, so there's an add_definition function that might be usable if we put all our model definitions in separate files. The concatenation code in seastar src/http/api_docs.cc knows how to list out all the api paths before any definitions.

However Scylla seems to use fully-formed swagger files which I guess means treating each sub-path in the API as a separate API in its own right from a docs/swagger POV.

dotnwat commented 2 years ago

I think that @BenPope has done the most with swagger stuff so he made know what's going on

BenPope commented 2 years ago

I gave up on using multiple files, it was not a nice experience: https://github.com/vectorizedio/redpanda/commit/128de604fa51529b47e87591b68a01bdfbce5075#diff-105db49bbcabef7358486b0a0e861348cb1af2fa90f68d9b09268b6281e71aa2