{"id":16677886,"url":"https://github.com/ramosbugs/openapi-lambda-rust","last_synced_at":"2026-02-17T07:54:40.495Z","repository":{"id":217777734,"uuid":"727521481","full_name":"ramosbugs/openapi-lambda-rust","owner":"ramosbugs","description":"Strongly-typed Rust code generation for AWS Lambda from OpenAPI definitions","archived":false,"fork":false,"pushed_at":"2024-01-18T06:07:07.000Z","size":129,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T21:16:09.612Z","etag":null,"topics":["aws","aws-lambda","aws-lambda-rust","openapi","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramosbugs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["ramosbugs"]}},"created_at":"2023-12-05T03:01:11.000Z","updated_at":"2025-02-13T00:31:57.000Z","dependencies_parsed_at":"2024-01-18T07:58:59.995Z","dependency_job_id":"1fbd0442-aadb-42db-8794-b57214eecba4","html_url":"https://github.com/ramosbugs/openapi-lambda-rust","commit_stats":null,"previous_names":["ramosbugs/openapi-lambda-rust"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramosbugs%2Fopenapi-lambda-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramosbugs%2Fopenapi-lambda-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramosbugs%2Fopenapi-lambda-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramosbugs%2Fopenapi-lambda-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramosbugs","download_url":"https://codeload.github.com/ramosbugs/openapi-lambda-rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245115910,"owners_count":20563254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-lambda-rust","openapi","rust"],"created_at":"2024-10-12T13:27:49.019Z","updated_at":"2026-02-17T07:54:40.482Z","avatar_url":"https://github.com/ramosbugs.png","language":"Rust","readme":"# OpenAPI Lambda for Rust 🦀\n\n[![crates.io](https://img.shields.io/crates/v/openapi-lambda.svg)](https://crates.io/crates/openapi-lambda)\n[![docs.rs](https://docs.rs/openapi-lambda/badge.svg)](https://docs.rs/openapi-lambda)\n\nOpenAPI Lambda for Rust takes an [OpenAPI definition](https://swagger.io/docs/specification)\nand generates Rust boilerplate code for running\nthe API \"serverlessly\" on [AWS Lambda](https://aws.amazon.com/lambda/) behind an\n[Amazon API Gateway](https://aws.amazon.com/api-gateway/) REST API. The generated code automatically routes\nrequests, parses parameters, marshals responses, invokes middleware to authenticate requests, and\nhandles related errors. This project's goal is to enable developers to focus on business logic, not\nboilerplate.\n\n**This project is not affiliated with the OpenAPI Initiative or Amazon Web Services (AWS).**\n\n## Usage\n\n### 1. Add dependencies\n\nAdd `openapi-lambda` as a dependency and `openapi-lambda-codegen` as a build dependency to your\ncrate's `Cargo.toml`:\n ```toml\n [dependencies]\n openapi-lambda = \"0.1\"\n \n [build-dependencies]\n openapi-lambda-codegen = \"0.1\"\n ```\nBoth crates must have identical version numbers in `Cargo.lock`.\n\n### 2. Generate code\nAdd a `build.rs` Rust [build script](https://doc.rust-lang.org/cargo/reference/build-scripts.html) to your crate's  root directory (see comments below):\n```rust,no_run\nuse openapi_lambda_codegen::{ApiLambda, CodeGenerator, LambdaArn};\n\nfn main() {\n  CodeGenerator::new(\n    // Path to OpenAPI definition (relative to build.rs).\n    \"openapi.yaml\",\n    // Output path to a directory for generating artifacts. This directory should be added to\n    // `.gitignore`.\n    \".openapi-lambda\",\n  )\n  // Define one or more Lambda functions for implementing the API. A single \"mono-Lambda\" may\n  // be used to handle all API endpoints, or endpoints may be grouped into multiple Lambda\n  // functions using filters (see docs). Note that Lambda cold start time is roughly\n  // proportional to the size of each Lambda binary, so consider splitting APIs into smaller\n  // Lambda functions to reduce cold start times.\n  .add_api_lambda(ApiLambda::new(\n    // Name of the generated Rust module that will contain the API types.\n    \"backend\",\n    // AWS CloudFormation logical ID or Amazon Resource Name (ARN) that the Lambda function\n    // will have when deployed to AWS. This value is used for adding\n    // `x-amazon-apigateway-integration` extensions to the OpenAPI definition, which tells\n    // API Gateway which Lambda function to use for handling each API request. If using\n    // CloudFormation/SAM with a logical ID, the ARN will be populated automatically during\n    // deployment.\n    LambdaArn::cloud_formation(\"BackendApiFunction.Alias\")\n  ))\n  .generate();\n}\n```\n\nInclude the generated code in your crate's `src/lib.rs`:\n```rust,ignore\ninclude!(concat!(env!(\"OUT_DIR\"), \"/out.rs\"));\n```\nThe generated file `out.rs` defines a module named `models` containing Rust types for the input\nparameters and request/response bodies defined in the OpenAPI definition. It also defines one\nmodule for each call to `add_api_lambda()`, which defines an `Api` trait with one\nmethod for each operation (path + HTTP method) defined in the OpenAPI definition.\n\n#### Generate documentation\n\nIt is often helpful to refer to \n[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html)\ndocumentation to understand the generated models and API types. To generate documentation, run:\n```shell\ncargo doc --open\n```\n\n### 3. Implement API handlers\n\nTo implement the API, implement the generated `Api` trait(s). To help you get started,\nthe code generator creates files named `\u003cMODULE_NAME\u003e_handler.rs`\nin the configured output directory (e.g., `.openapi-lambda/backend_handler.rs`) with a placeholder\nimplementation of each `Api` trait. Copy these files into `src/`, define corresponding modules in\n`src/lib.rs` (e.g., `mod backend_handler`),\nand replace each `todo!()` to implement the API.\n\nEach `Api` trait declares two associated types that you must define in your implementation:\n * `AuthOk`: the outcome of successful request authentication returned by your middleware (see\n   below). This might represent a user, authentication session, or other abstraction relevant to\n   your API. If none of the API endpoints require authentication, simply use the unit type (`()`).\n * `HandlerError`: the error type returned by each API handler method. A typical API\n   will define an `enum` type for errors and have the `Api::respond_to_handler_error()` method\n   return appropriate HTTP responses depending on the nature of the error (e.g., status code 403 for\n   access denied errors).\n\n### 4. Implement middleware\n\nThe `openapi_lambda::Middleware` trait defines the interface for authenticating requests and\noptionally wrapping each API handler to add functionality such as logging and telemetry. \nA convenience\n`UnauthenticatedMiddleware` implementation is provided for APIs with no endpoints\nthat require authentication.\n\n#### Authenticating requests\n\nThe `Middleware::AuthOk` associated type represents the outcome of a successful call to the\n`Middleware::authenticate()` trait method. This is a type you define that might represent a user,\nauthentication session, or\nother abstraction relevant to your API. If none of the API endpoints require authentication, simply\nuse the unit type (`()`). The `Middleware::AuthOk` associated type must match the `Api::AuthOk`\nassociated type in your `Api` trait implementation(s).\n\nThe `Middleware::authenticate()` method provides a `headers` argument with access to all request\nheaders, allowing you to authenticate requests using headers such as\n[`Authorization`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) or\n[`Cookie`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie).\nIt also provides a `lambda_context` argument with access to Amazon Cognito identity information\nif using an API Gateway\n[Cognito user pool authorizer](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-integrate-with-cognito.html).\n\nIf the request fails\nto authenticate, be sure to return an `HttpResponse` with the appropriate HTTP status code\n(i.e., 401).\n\n### 5. Add binary target(s)\n\nDefine a binary target for each Lambda function (e.g., `bin/bootstrap_backend.rs`) to bootstrap the\nLambda runtime. The `openapi_lambda::run_lambda()` function is the recommended entry point to start\nthe Lambda runtime and begin handling API requests:\n\n```rust,ignore\n// Replace `my_api` with the name of your crate and `backend` with the name of the module\n// passed to `ApiLambda::new()`.\nuse my_api::backend::Api;\nuse my_api::backend_handler::BackendApiHandler;\nuse openapi_lambda::run_lambda;\n\n#[tokio::main]\npub async fn main() {\n  let api = BackendApiHandler::new(...);\n  let middleware = ...; // Instantiate your middleware here.\n\n  run_lambda(|event| api.dispatch_request(event, \u0026middleware)).await\n}\n```\n\n### 6. Compile binaries\n\n#### Cargo Lambda\n\nThe easiest way to compile Lambda functions written in Rust is with\n[Cargo Lambda](https://www.cargo-lambda.info/), which handles any necessary cross-compilation from\nyour development environment to AWS Lambda (either x86-64 or ARM-based).\n\nIn addition to installing Cargo Lambda, be sure to install the relevant target\n(`x86_64-unknown-linux-gnu` or `aarch64-unknown-linux-gnu` depending on the targeted Lambda\nfunction architecture) for your Rust toolchain (e.g., via\n`rustup target add`).\n\nAfter installing Cargo\nLambda, run the following command to build Lambda `bootstrap` binaries in the `target/lambda/`\ndirectory:\n```shell\ncargo lambda build --release\n```\nIf targeting ARM-based Lambda functions, be sure to add the `--arm64` flag.\n\n#### `musl-cross`\n\nAn alternative to Cargo Lambda is [`musl-cross`](https://github.com/richfelker/musl-cross-make),\nwhich provides [better backtrace support](https://github.com/ziglang/zig/issues/18280) when\ncompiling on certain environments such as macOS with Apple Silicon. A\n[Homebrew package](https://github.com/FiloSottile/homebrew-musl-cross) is available for easy\ninstallation on macOS.\n\nIn addition to installing `musl-cross`, be sure to install the relevant target\n(`x86_64-unknown-linux-musl` or `aarch64-unknown-linux-musl` depending on the targeted Lambda\nfunction architecture) for your Rust toolchain (e.g., via\n`rustup target add`).\n\nTo compile binaries for x86-64 Lambda functions, run:\n```shell\nCARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-gcc \\\n  cargo build --target x86_64-unknown-linux-musl --release\n```\n\nTo compile binaries for ARM Lambda functions, run:\n```shell\nCARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc \\\n  cargo build --target aarch64-unknown-linux-musl --release\n```\n\nThe final binaries are written to the `target/x86_64-unknown-linux-musl/release/` or\n`target/aarch64-unknown-linux-musl/release/` directory, depending on the target architecture.\n\n### 7. Test and deploy\n\nDeploying to AWS involves creating one or more\n[Lambda functions](https://docs.aws.amazon.com/lambda/latest/dg/getting-started.html) and an\n[API Gateway REST API](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-rest-api.html).\n\nLambda functions written in Rust should use one of the `provided`\n[Lambda runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html).\nThe `provided` runtimes require each Lambda function to include a binary named `bootstrap`, which \nis produced by the compilation step above.\n\nAn API Gateway REST API uses an OpenAPI definition annotated with\n[`x-amazon-apigateway-integration`](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html)\nextensions that determine which Lambda function is used for\nhandling each API endpoint. The `openapi-lambda-codegen` crate writes an annotated\nOpenAPI definition suitable for this purpose to a file named `openapi-apigw.yaml` in the output\ndirectory specified in `build.rs` (e.g., `.openapi-lambda/openapi-apigw.yaml`). This OpenAPI\ndefinition is modified from the input to help adhere to the\n[subset of OpenAPI features](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis)\nsupported by Amazon API Gateway. In particular, all references are merged into a single file, and\n`discriminator` properties are removed.\n\nAs a best practice, consider using an infrastructure-as-code (IaC) solution such as\n[AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide),\n[AWS Serverless Application Model](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/index.html)\n(SAM), or [Terraform](https://www.terraform.io/).\n\n####  AWS Serverless Application Model (SAM)\n\nThe\n[Petstore](https://github.com/ramosbugs/openapi-lambda-rust/tree/main/examples/petstore) example\nprovides a working AWS SAM template (`template.yaml`) and accompanying `Makefile`.\n\nAWS SAM provides both a streamlined version of CloudFormation tailored to serverless use cases and\na command-line interface (CLI) for deploying to AWS and locally testing APIs.\n\nWhen defining a SAM CloudFormation stack template, define an\n[`AWS::Serverless::Function`](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)\nresource for each Lambda function. Be sure to specify the same logical ID (i.e., YAML key) in your\n`build.rs` Rust build script using the `LambdaArn::cloud_formation()` function. If\nspecifying an\n[`AutoPublishAlias`](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html#sam-function-autopublishalias)\nproperty (recommended), append the `.Alias` suffix to the logical ID passed to\n`LambdaArn::cloud_formation()`. This ensures that API Gateway always executes the version of your\nfunction associated with the specified alias. Aliases help support quick rollbacks in production\nby simply updating the alias to point to a previous version of the Lambda function, without waiting\nfor a full stack deploy.\n\nEach `AWS::Serverless::Function` resource should specify\n`BuildMethod: makefile` in the `Metadata` attribute (see\n[Building custom runtimes](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/building-custom-runtimes.html)). The resource should also specify a `CodeUri` attribute that points\nto a directory containing your crate. A `Makefile` must exist in the specified directory. The\n`Makefile` must define a target named `build-LOGICAL_ID`, where `LOGICAL_ID` is the logical ID (YAML\nkey) of  the resource in the SAM template. The `build-LOGICAL_ID` target must copy a binary named\n`bootstrap` to the directory referenced by the `ARTIFACTS_DIR` environment variable (set at build\ntime by the AWS SAM CLI). See the\n[Petstore](https://github.com/ramosbugs/openapi-lambda-rust/tree/main/examples/petstore) example\nfor details.\n\nThe SAM template must also include an\n[`AWS::Serverless::Api`](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-api.html)\nresource that defines the API Gateway REST API. Use the\n[`AWS::Include`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html)\ntransform along with the annotated OpenAPI definition `openapi-apigw.yaml`, which automatically\nresolves the logical IDs of each Lambda function to the corresponding\n[Amazon Resource Name](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html) (ARN)\nduring deployment:\n\n```yaml\nResources:\n  MyApi:\n    Type: AWS::Serverless::Api\n    Properties:\n      Name: my-api\n      StageName: prod\n      DefinitionBody:\n        Fn::Transform:\n          Name: AWS::Include\n          Parameters:\n            Location: .openapi-lambda/openapi-apigw.yaml\n```\n\nBefore testing or deploying an AWS SAM template, build it by running:\n```shell\nsam build\n```\n\nTo start the API locally for testing, run:\n```shell\nsam local start-api\n```\n\nTo deploy the template to AWS, run:\n```shell\nsam deploy\n```\n\n## Example\n\nThe [Petstore](https://github.com/ramosbugs/openapi-lambda-rust/tree/main/examples/petstore) example\nillustrates how to use this crate together with\n[AWS SAM](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/index.html)\nto build, test, and deploy an API to AWS Lambda behind an Amazon API Gateway REST API.\n\n## Minimum supported Rust version (MSRV)\n\nThe minimum supported Rust version (MSRV) of this crate is **1.70**.\n\nThis crate maintains a policy of supporting Rust releases going back at least 6 months. Changes that\nbreak compatibility with Rust releases older than 6 months will not be considered SemVer\nbreaking changes and will not result in a new major version number for this crate. MSRV changes will\ncoincide with minor version updates and will not happen in patch releases.\n\n## Logging\n\nThe generated code uses the [`log`](https://crates.io/crates/log) crate to log requests. Consider\nusing the [`log4rs`](https://crates.io/crates/log4rs) or\n[`env_logger`](https://crates.io/crates/env_logger) crates to enable logging in each Lambda\nfunction's `main()` entry point.\n\nEnabling `TRACE` level logs will log the raw contents of each request and response. This can be\nuseful for debugging, but **`TRACE` logs should never be enabled in production**. In addition to\nbeing verbose (incurring\n[Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/LogsBillingDetails.html)\ncharges), enabling `TRACE` logs in production could log sensitive secrets such as passwords and API\nkeys.\n\n## OpenAPI support\n\nThe code generator supports a large portion of the\n[OpenAPI 3.0 specification](https://github.com/OAI/OpenAPI-Specification/blob/ecc4e50cf60620c44e1e8f2bee31395f95685e75/versions/3.0.3.md),\nbut gaps remain. If you encounter an `unimplemented!` error when generating code, please\n[submit a GitHub issue](https://github.com/ramosbugs/openapi-lambda-rust/issues/new) or open a\npull request (see\n[`CONTRIBUTING.md`](https://github.com/ramosbugs/openapi-lambda-rust/tree/main/CONTRIBUTING.md)).\n\nReferences (`$ref`) found in OpenAPI definitions are supported, including references to objects in\nother files. However, references that resolve to other references are currently not supported.\n\nEvery endpoint must have an `operationId` property, which must be unique across all endpoints. The\n`operationId` property is used for routing requests and naming the handler method and related types\nin the generated code.\n\n### Authenticated vs. unauthenticated API endpoints\n\nBy default, all API endpoints are assumed to require authentication. This means that\n`Middleware::authenticate()` is invoked, and the `AuthOk` result is passed to the handler\nmethod.\n\nTo denote an endpoint as *unauthenticated*, add an empty object (`{}`) to the\n[`security`](https://github.com/OAI/OpenAPI-Specification/blob/ecc4e50cf60620c44e1e8f2bee31395f95685e75/versions/3.0.3.md#security-requirement-object)\nproperty for the endpoint. For example:\n```yaml\nsecurity:\n  - {}\n```\nUnauthenticated endpoints will have their handlers invoked without calling\n`Middleware::authenticate()`, and the handler method will not receive an `AuthOk` parameter. \n\nNote that \"unauthenticated\" in this context simply means that the middleware will not be used to\nauthenticate requests. The handler method you implement may still perform its own authentication.\nThis is often useful for login endpoints (for which no authentication session exists yet), or for\nwebhook endpoints that require access to the raw request body in order to authenticate the request\n(e.g., using an HMAC). In the latter case, a request body schema with `type: string` (optionally\nwith `format: binary`) should be used. The handler method can deserialize the body after verifying\nthe HMAC.\n\n### Request parameters\n\nRequest parameters must define a single `schema` property. The `content` property is currently not\nsupported.\n\nCookie parameters (`in: cookie`) are currently not supported. Header parameters (`in: header`) must\nbe plain string schemas.\n\nWhere supported, non-string parameter types must implement the `FromStr` trait for parsing. Object\ntypes are not supported in request parameters.\n\n### Request/response bodies\n\nRequest and response bodies that define more than one media type are currently not supported.\n\nThe code generator represents request and response bodies as Rust types according to the following\ntable. [GitHub issues](https://github.com/ramosbugs/openapi-lambda-rust/issues/new) and\npull requests that add support for other widely-used data formats are encouraged.\n\n| Media type                 | Schema `type` | Rust type                                                    | (De)serialization |\n|----------------------------|---------------|--------------------------------------------------------------|-------------------|\n| `application/json`         | `string`      | `Vec\u003cu8\u003e` for `format: binary` or `String` (UTF-8) otherwise | None              |\n| `application/json`         | Non-`string`  | See below                                                    | `serde_json`      |\n| `application/octet-stream` | Any           | `Vec\u003cu8\u003e`                                                    | None              |\n| `text/*`                   | Any           | `String` (UTF-8)                                             | None              |\n| Others (fallback)          | Any           | `Vec\u003cu8\u003e`                                                    | None              |\n\n#### Strings (`type: string`)\n\nString schemas that specify at least one `enum` variant will result in a named Rust `enum`\nbeing generated. Please note that `null` variants are currently not supported.\n\nNon-`enum` string types are determined by the `format` property, as indicated in the table\nbelow:\n\n| `format`              | Rust type                                                                               |\n|-----------------------|-----------------------------------------------------------------------------------------|\n| Unspecified (default) | `String`                                                                                |\n| `date`                | [`chrono::NaiveDate`](https://docs.rs/chrono/latest/chrono/naive/struct.NaiveDate.html) |\n| `date-time`           | [`chrono::DateTime\u003cUtc\u003e`](https://docs.rs/chrono/latest/chrono/struct.DateTime.html)    |\n| `byte`                | `String` (without base64 decoding)                                                      |\n| `password`            | `String`                                                                                |\n| `binary`              | `Vec\u003cu8\u003e`                                                                               |\n| Other                 | Treated as a verbatim Rust type                                                         |\n\n#### Integers (`type: integer`)\n\nInteger `enum`s are currently not supported. Non-`enum` integer types are determined by the `format`\nproperty, as indicated in the table below:\n\n| `format`              | Rust type                       |\n|-----------------------|---------------------------------|\n| Unspecified (default) | `i64`                           |\n| `int32`               | `i32`                           |\n| `int64`               | `i64`                           |\n| Other                 | Treated as a verbatim Rust type |\n\n#### Floating-point numbers (`type: number`)\n\nNumber `enum`s are currently not supported. Non-`enum` number types are determined by the `format`\nproperty, as indicated in the table below:\n\n| `format`              | Rust type                       |\n|-----------------------|---------------------------------|\n| Unspecified (default) | `f64`                           |\n| `float`               | `f32`                           |\n| `double`              | `f64`                           |\n| Other                 | Treated as a verbatim Rust type |\n\n#### Booleans (`type: boolean`)\n\nBoolean `enum`s are currently not supported. Booleans are always represented as `bool`.\n\n#### Objects (`type: object`)\n\nThe table below specifies the generated Rust types depending on an object schema's\n`properties` and `additionalProperties` fields. Please note that `properties` entries with schemas\nthat are objects or `enum`s must use references (`$ref`) to named schemas. Other property types\nmay use inline schemas or references.\n\n| `properties` | `additionalProperties` | Rust type                                                                      |\n|--------------|------------------------|--------------------------------------------------------------------------------|\n| At least one | `false` or unspecified | Named `struct`                                                                 |\n| At least one | `true`                 | Named `struct` + `HashMap\u003cString, serde_json::Value\u003e` with `#[serde(flatten)]` |\n| At least one | Schema                 | Named `struct` + `HashMap\u003cString, _\u003e` with `#[serde(flatten)]`                 |\n| None         | `false` or unspecified | `openapi_lambda::models::EmptyModel`                                           |\n| None         | `true`                 | `HashMap\u003cString, serde_json::Value\u003e`                                           |\n| None         | Schema                 | `HashMap\u003cString, _\u003e`                                                           |\n\n#### Arrays (`type: array`)\n\nArray schemas with `uniqueItems: true` are represented as\n[`indexmap::IndexSet\u003c_\u003e`](https://docs.rs/indexmap/latest/indexmap/set/struct.IndexSet.html). All\nother arrays are represented as `Vec\u003c_\u003e`.\n\n#### Polymorphism (`oneOf`)\n\nA named Rust `enum` is generated for schemas utilizing `oneOf`, with one variant for each\nentry contained in the `oneOf` array. If a `discriminator` is\nspecified, a Serde [internally-tagged](https://serde.rs/enum-representations.html#internally-tagged)\n`enum` is generated, with that field as the tag. Otherwise, a Serde\n[untagged](https://serde.rs/enum-representations.html#untagged) enum is generated.\n\nPlease note that each `oneOf` variant must be a named reference (`$ref`), which determines the name\nof the Rust `enum` variant. Each referenced schema must be either an object schema (`type: object`)\nor utilize `allOf`. Inline variant schemas are not supported.\n\n#### Composed objects (`allOf`)\n\nSchemas utilizing `allOf` are treated as objects (see above) after merging all of the component\nschemas into a single schema of `type: object`. Each component of an `allOf` schema must be an\nobject or a nested `allOf` schema. At most one component may define `additionalProperties`.\n\n#### Other schema types\n\nSchemas utilizing `anyOf` or `not` are currently not supported.\n\n### Responses\n\nResponses must specify individual HTTP status codes. Status code ranges are currently not supported.\n","funding_links":["https://github.com/sponsors/ramosbugs"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framosbugs%2Fopenapi-lambda-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framosbugs%2Fopenapi-lambda-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framosbugs%2Fopenapi-lambda-rust/lists"}