Crate k8s_openapi_codegen_common
source ·Expand description
This crate contains common code for the k8s-openapi code generator
and the k8s-openapi-derive custom derive crate.
It can be used by code generators that want to generate crates like k8s-openapi and k8s-openapi-derive for Kubernetes-like software
such as OpenShift.
- Create a
swagger20::Specvalue, either by deserializing it from an OpenAPI spec JSON file or by creating it manually. - Invoke the
runfunction for each definition in the spec. - For each left-over API operations, ie those operations that weren’t associated with any definition, invoke the
write_operationfunction.
Modules
- This module contains types related to the OpenAPI types used in the Kubernetes spec.
Structs
- Error type reported by
runandwrite_operation - Statistics from a successful invocation of
run
Enums
- Whether
runshould generate an impl ofschemars::JsonSchemafor the type or not.
Traits
- A mechanism for converting (the components of) an openapi path to (the components of) a Rust namespace.
- Used to create an impl of
std::io::Writefor each type that the type’s generated code will be written to.
Functions
- Converts the given string into a string that can be used as a Rust ident.
- Each invocation of this function generates a single type specified by the
definition_pathparameter along with its associated API operation functions. - Each invocation of this function generates a single API operation function specified by the
operationparameter.