[p3t] More experiments with OpenAPI schema
Russ Allbery
eagle at eyrie.org
Mon Apr 22 20:29:47 CEST 2024
I've made a version of the previous 3.1.0 OpenAPI schema for cone-search
that uses OpenAPI 3.0.3 instead, and have pushed that up to the
repository.
I successfully used that to generate a Rust client, using OpenAPI
Generator (https://openapi-generator.tech/docs/installation). The
resulting code looks reasonable. It's a bit awkward and certainly errs on
the side of long names for everything, but all the types seem correct and
are plugged into serialization the way that I would expect. I'm still not
sure that I would directly use the generated code for anything other than
a starting point, but it's a reasonable starting point.
It was a bit hard to find a Rust OpenAPI code generator that actually
worked. None of paperclip, progenitor, or swagger-codegen accepted the
schema, all with extremely unhelpful and cryptic error messages, even
though the on-line Swagger editor said it was warning-free. But OpenAPI
Generator worked fine.
--
Russ Allbery (eagle at eyrie.org) <https://www.eyrie.org/~eagle/>
More information about the p3t
mailing list