Skip to content

oproto/lambda-openapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Oproto Lambda OpenAPI

Oproto Lambda OpenAPI

Build Status NuGet License: MIT Sponsor

A .NET source generator that automatically creates OpenAPI specifications from AWS Lambda functions decorated with Lambda Annotations.

Features

  • πŸš€ Source Generator: Compile-time OpenAPI spec generation
  • 🏷️ Attribute-Based: Simple attribute decoration for API documentation
  • πŸ”§ MSBuild Integration: Seamless integration with your build process
  • πŸ“ AWS Lambda Support: Designed specifically for Lambda Annotations
  • 🎯 Type-Safe: Leverages C# type system for accurate schemas
  • ⚑ AOT Compatible: Works with Native AOT compilation
  • πŸ“‚ Tag Groups: Organize tags into logical groups with x-tagGroups extension for better documentation navigation
  • πŸ”„ Automatic Examples: Compose request/response examples from property-level schema values

OpenAPI Merge Tool

The ecosystem also includes a powerful merge tool for combining multiple OpenAPI specifications into a single unified document. This is ideal for microservice architectures where each service generates its own OpenAPI spec.

Project Website and Documentation

Documentation, examples and more are located on LambdaOpenApi website.

Installation

# Install as a global tool
dotnet tool install -g Oproto.Lambda.OpenApi.Merge.Tool

# Or install as a local tool
dotnet new tool-manifest
dotnet tool install Oproto.Lambda.OpenApi.Merge.Tool

Quick Start

# Merge multiple specs with CLI arguments
dotnet openapi-merge merge --title "My API" --version "1.0.0" -o merged.json api1.json api2.json

# Or use a configuration file
dotnet openapi-merge merge --config merge.config.json

For detailed documentation, see Merge Tool Documentation.


Requirements

The library targets netstandard2.0 for maximum compatibility.

Installation

Install the NuGet package in your AWS Lambda project:

dotnet add package Oproto.Lambda.OpenApi

Quick Start

  1. Decorate your Lambda functions with OpenAPI attributes:
using Oproto.Lambda.OpenApi.Attributes;

[LambdaFunction]
[OpenApiOperation("GetUser", "Retrieves user information")]
[OpenApiTag("Users")]
public async Task<APIGatewayProxyResponse> GetUser(
    [FromRoute] string userId,
    [FromQuery] bool includeDetails = false)
{
    // Your implementation
}
  1. Build your project - the OpenAPI spec will be generated automatically as openapi.json

Documentation

About

Oproto Lambda OpenAPI is developed and maintained by Oproto Inc, a company building modern SaaS solutions for small business finance and accounting.

Related Projects

Links

Maintainer

❀️ Support the Project

Oproto maintains this library as part of a broader open-source ecosystem for building high-quality AWS-native .NET applications. If Lambda OpenAPI (or any Oproto library) saves you time or helps your team ship features faster, please consider supporting ongoing development.

Your support helps:

  • Fund continued maintenance of the Oproto Lambda ecosystem
  • Keep libraries AOT-compatible and aligned with new AWS features
  • Improve documentation, samples, and test coverage
  • Sustain long-term open-source availability

You can support the project in one of two ways:

πŸ‘‰ GitHub Sponsors β€” Recurring support for those who want to help sustain long-term development.

πŸ‘‰ Buy Me a Coffee β€” A simple, one-time "thanks" for helping you ship faster.

Every bit of support helps keep the project healthy, actively maintained, and open for the community. Thank you!

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Security

To report a security vulnerability, please see our Security Policy.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Built with ❀️ for the .NET and AWS communities

About

OpenAPI generation tooling for AWS Lambda Annotations

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Languages