Skip to main content

Module codegen

Module codegen 

Source
Expand description

Code generation from OpenAPI and AsyncAPI schemas

Re-exports§

pub use formatters::Formatter;
pub use formatters::HeaderMetadata;
pub use formatters::Import;
pub use formatters::PythonFormatter;
pub use formatters::RubyFormatter;
pub use formatters::Section;
pub use formatters::TypeScriptFormatter;

Modules§

common
Common utilities for code generation across all language targets.
formatters
Formatters for language-specific code generation output
quality
Quality validation framework for generated code
sql
Glue between the CLI and spikard_codegen::sql.
ts_schema

Structs§

CodegenEngine
Code generation runtime orchestrating schema parsing and artifact generation
CodegenRequest
Request executed by the code generation engine
DtoConfig
DTO configuration per language.
ElixirGenerator
EnumDef
Protobuf enum definition
EnumValue
Protobuf enum value
FieldDef
Protobuf field definition
GeneratedAsset
Represents an asset emitted by the code generation engine
GraphQLArgument
Represents a GraphQL field argument
GraphQLDirective
Represents a GraphQL directive
GraphQLEnumValue
Represents an enum value
GraphQLField
Represents a GraphQL field (on Object or Interface types)
GraphQLInputField
Represents an input field (for InputObject types)
GraphQLSchema
Parsed GraphQL schema representation
GraphQLType
Represents a GraphQL type definition
MessageDef
Protobuf message definition
MethodDef
Protobuf RPC method definition
PhpDtoGenerator
PHP DTO generator
PhpGenerator
ProtobufSchema
Parsed Protobuf schema representation
PythonGenerator
RubyGenerator
RustGenerator
SchemaRegistry
Simple registry that lets generators resolve $ref identifiers to concrete schemas.
TypeScriptGenerator

Enums§

CodegenOutcome
Output of the engine run
CodegenTargetKind
Type of artifact to generate for a schema
ElixirDtoStyle
FieldLabel
Protocol Buffer field label
NodeDtoStyle
PhpDtoStyle
ProtoType
Protocol Buffer type enumeration
ProtobufTarget
Target specification for Protobuf code generation
Protocol
Protocol types supported by AsyncAPI
PythonDtoStyle
RubyDtoStyle
RustDtoStyle
SchemaKind
Code generation schema families supported by the CLI
TargetLanguage
Supported target languages for code generation
TypeKind
GraphQL type category

Traits§

OpenApiGenerator
Base trait for OpenAPI code generators to eliminate duplication across languages.
ProtobufGenerator
Language-agnostic Protobuf code generator trait

Functions§

detect_primary_protocol
Determine primary protocol from AsyncAPI spec
generate_elixir_graphql
Generate Elixir GraphQL code from a schema.
generate_elixir_protobuf
Generate Elixir Protobuf code from a schema.
generate_fixtures
Generate fixture files from message schemas
generate_from_openapi
Generate server code from an OpenAPI schema file
generate_nodejs_handler_app
Generate Node.js handler scaffolding from AsyncAPI spec
generate_nodejs_test_app
Generate Node.js test application from AsyncAPI spec
generate_openrpc_php_handler_app
Generate PHP handler scaffolding from OpenRPC spec
generate_openrpc_python_handler_app
Generate Python handler scaffolding from OpenRPC spec
generate_openrpc_ruby_handler_app
Generate Ruby handler scaffolding from OpenRPC spec
generate_openrpc_rust_handler_app
Generate Rust handler scaffolding from OpenRPC spec
generate_openrpc_typescript_handler_app
Generate TypeScript handler scaffolding from OpenRPC spec
generate_php_graphql
Generate PHP GraphQL code from a schema
generate_php_handler_app
Generate PHP handler scaffolding from AsyncAPI spec
generate_php_protobuf
Generate PHP Protobuf code from a schema
generate_python_graphql
Generate Python GraphQL code from a schema
generate_python_handler_app
Generate Python handler scaffolding from AsyncAPI spec
generate_python_protobuf
Generate Python Protobuf code from a schema
generate_python_test_app
Generate Python test application from AsyncAPI spec
generate_ruby_graphql
Generate Ruby GraphQL code from a schema
generate_ruby_handler_app
Generate Ruby handler scaffolding from AsyncAPI spec
generate_ruby_protobuf
Generate Ruby Protobuf code from a schema
generate_ruby_test_app
Generate Ruby test application from AsyncAPI spec
generate_rust_graphql
Generate Rust GraphQL code from a schema
generate_rust_handler_app
Generate Rust handler scaffolding from AsyncAPI spec
generate_typescript_graphql
Generate TypeScript GraphQL code from a schema
generate_typescript_protobuf
Generate TypeScript Protobuf code from a schema
parse_asyncapi_schema
Parse an AsyncAPI v3 specification file
parse_graphql_schema
Auto-detect format and parse GraphQL schema
parse_graphql_sdl
Parse GraphQL SDL from a file
parse_graphql_sdl_string
Parse GraphQL SDL from a string
parse_openapi_schema
Parse an OpenAPI schema from a file (JSON or YAML)
parse_openrpc_schema
Parse an OpenRPC 1.3.2 specification file
parse_proto_schema
Parse a Protobuf schema from a .proto file
parse_proto_schema_string
Parse a Protobuf schema from a string