Bootstrap
The idea is to use openapi code generator for rust to generate openapi specification library. To do so, I started with an openapi specification with
Build OpenAPI In OpenAPI
- Download json-schema of OpenAPI v3.1
- Copy everything from
schema.$def
into the above OpenAPI json insidecomponents.schemas
- Insert
openapi
definition intocomponents.schemas
- Replace every
#/$defs/
with#/componenst/schemas
- Remove every
"$ref": "#/$defs/specification-extensions"
. We don't need them now. - Remove every
oneOf
. We will add them later in the generated code.
See the result file here.
Generate Code
&&
Implement The Remaining Part
Generated code is not complete, and don't generate these structs. We will create them by hand :-) .
path-item-or-reference
parameter-or-reference
request-body-or-reference
response-or-reference
callbacks-or-reference
example-or-reference
link-or-reference
header-or-reference
security-scheme-or-reference