NSwag VS Protobuf.NET

Compare NSwag vs Protobuf.NET and see what are their differences.

NSwag

The Swagger/OpenAPI toolchain for .NET, ASP.NET Core and TypeScript. (by RicoSuter)

Protobuf.NET

Protocol Buffers library for idiomatic .NET (by protobuf-net)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
NSwag Protobuf.NET
39 10
6,482 4,525
- 1.5%
8.9 6.2
16 days ago 5 days ago
C# C#
MIT License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

NSwag

Posts with mentions or reviews of NSwag. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-12-07.
  • This week I released v2.1 of my text-templating library Weave that now uses Source Generators by default.
    6 projects | /r/dotnet | 7 Dec 2023
    I'm mostly using it for C# API client generation from backend code - sort of similar to what a tool like NSwag Studio will do. I think NTypewriter has more flexibility though, and having a live view with the VS plugin makes development quick.
  • OpenAPI v4 Proposal
    24 projects | news.ycombinator.com | 31 May 2023
    NSwag does a wonderful job of generating TypeScript clients from OpenAPI specs. Definitely give it a shot before killing your current setup.

    https://github.com/RicoSuter/NSwag (It sucks in any OpenAPI yml, not just ones from Swashbuckle/C#)

  • Looking for an alternative to NSwag
    2 projects | /r/dotnet | 18 May 2023
  • The Typescript ecosystem is exhausting
    3 projects | /r/typescript | 14 May 2023
    I use this https://github.com/RicoSuter/NSwag but it's designed for .Net backends to some extent. But you can use the client generation from the command line or manually with the standalone client app.
  • Code generation from Swagger specification file
    2 projects | /r/dotnet | 22 Apr 2023
  • Tool for generating example API requests and responses from OpenAPI
    4 projects | /r/api | 3 Apr 2023
    Here are three tools that you can use to generate example API requests and responses from OpenAPI specifications. These tools should work well even if your schemas are deeply nested: Nswag (Command Line and GUI): Nswag is a Swagger/OpenAPI toolchain for .NET, TypeScript, and other platforms. It supports code generation, client generation, and API documentation. You can use NswagStudio, which is a graphical interface, or you can use the command line tool called "NSwag.exe" for generating example API requests and responses. GitHub: https://github.com/RicoSuter/NJsonSchema NswagStudio: https://github.com/RicoSuter/NSwag/wiki/NSwagStudio Dredd (Command Line): Dredd is a language-agnostic command-line tool for validating API descriptions against backend implementations. It supports OpenAPI, Swagger, and API Blueprint formats. Dredd can generate example requests and responses and validate whether your API implementation conforms to the API description. GitHub: https://github.com/apiaryio/dredd Documentation: https://dredd.org/en/latest/ Stoplight Studio (GUI): Stoplight Studio is a modern API design and documentation platform that supports OpenAPI and JSON Schema. It allows you to create, edit, and validate OpenAPI specifications and provides a powerful visual interface for generating example API requests and responses. Website: https://stoplight.io/studio/ GitHub: https://github.com/stoplightio/studio These tools should provide you with the ability to generate example API requests and responses from your OpenAPI specifications and handle deeply nested schemas.
  • Help me to generate swagger json Net 6
    1 project | /r/dotnetcore | 25 Feb 2023
  • Web API generate of swagger json file
    1 project | /r/dotnet | 21 Feb 2023
    I’ve got an ASP.NET Core web API - I integrate NSwag (which I prefer to Swashbuckle - personal preference), run the app locally to generate the actual JSON file. See https://github.com/RicoSuter/NSwag Then I have a Bicep file that creates the API from the OpenAPI specification. Sorry - I don’t do Terraform (most of the Azure samples are of Bicep, but it should be easy to convert).
  • Open API Generators for Typescript / Node?
    1 project | /r/webdev | 21 Jan 2023
    I have actually found that, but I was hoping for something with more popularity. E.g. this one is for .NET: https://github.com/RicoSuter/NSwag ( you can also generate typescript clients). But I do not want to bring in the dependency to another language, if possible.
  • Best practices of create models for back-end commutation.
    3 projects | /r/Angular2 | 26 Oct 2022
    If your API exposes a Swagger definition, you can use NSwag (https://github.com/RicoSuter/NSwag) to generate the TypeScript API Client and Models for you. We found this eliminates errors due to TS and API DTO’s not matching

Protobuf.NET

Posts with mentions or reviews of Protobuf.NET. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-02-09.
  • ProtoBuf message serialization in Akka.NET using protobuf-net
    2 projects | dev.to | 9 Feb 2023
    This article requires that reader is familar with core concept of Akka.NET serialization (see https://getakka.net/articles/serialization/serialization.html) and ProtoBuf-Net library (see https://github.com/protobuf-net/protobuf-net).
  • Auto-Incrementing Sequences
    2 projects | dev.to | 8 Jan 2023
    The model used, a simple invoice which uses protobuf-net 1 NuGet package to store information in a binary file.
  • A .NET source generator for generating object mappings. Trimming save and fast. Inspired by MapStruct.
    3 projects | /r/programming | 28 Feb 2022
    Not sure if it works with gRPC but I really like how Protobuf.NET uses attributes like other serializers instead of needing to write a .proto and generate (not-very-C#-friendly) classes from it. Well, until you need to interop with other languages.
  • Practice resources for handling and optimizing large game data sets?
    3 projects | /r/Unity3D | 1 Feb 2022
    I mentioned JSON, but there are many formats that are much more efficient. I can mention FlatBuffers, MessagePack and ProtoBuf. These are the ones I've used myself, and personally I'm most comfortable with MessagePack and ProtoBuf. I don't think the performance would be an issue if you had to choose between these three, it's mostly the API that is different.
  • Automatically generate proxy services for blazor wasm+asp.net core?
    1 project | /r/Blazor | 27 Jan 2022
    The closest way would be using Grpc.Web + Protobuf.net. The overall experience is pretty close to WCF server + Client where you share a common interface and let the client and server just call through those.
  • gRPC Development experience in modern .NET
    7 projects | /r/dotnet | 12 Nov 2021
    Grpc Web with Blazor WASM is a really pleasant experience so far imo for my personal projects at home. You have strongly typed models and methods and you have choice on sharing the contract between client and server if you're using code first instead of proto IDL files (e.g. protobuf-net).
  • What is your preferred way of creating application specific files for a local application?
    3 projects | /r/csharp | 4 Sep 2021
  • Integrating Apollo Studio with GraphQL for .NET - Part 2
    2 projects | dev.to | 28 May 2021
    It's pretty straight-forward to follow the protobuf-net docs to serialize the report, but we should really GZIP the stream for sending to reduce bandwidth consumption and improve performance:
  • Integrating Apollo Studio with GraphQL for .NET - Part 1
    2 projects | dev.to | 27 May 2021
    There are a number of Protobuf implementations for .NET Core, but I like protobuf-net as it's a nice, clean, Apache 2.0 Licensed implementation. It is also supported by protogen, a great online generator that will output protobuf-net classes ready for use (for its CSharp profile). If you open the latest schema from the link here, you can simply paste into the generator. NOTE: At the time of writing, [(js_preEncoded)=true] isn't supported by the generator, and can be removed from the proto schema.
  • Don't Use Protobuf for Telemetry
    8 projects | news.ycombinator.com | 30 Dec 2020
    > Protobuf-java is a little heavy [...] Just depending on the library adds 1.6MB and nearly 700 classes before you even generate your own message classes.

    By comparison, protobuf-net [1] is about 260KB and 68 classes. Python's [2] is a 1MB package download (with source).

    Why's the Java one so big?

    [1] https://github.com/protobuf-net/protobuf-net

    [2] https://pypi.org/project/protobuf

What are some alternatives?

When comparing NSwag and Protobuf.NET you can also consider the following projects:

openapi-generator - OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

Protobuf - Protocol Buffers - Google's data interchange format

autorest - OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python

MessagePack for C# (.NET, .NET Core, Unity, Xamarin) - Extremely Fast MessagePack Serializer for C#(.NET, .NET Core, Unity, Xamarin). / msgpack.org[C#]

Refit - The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.

Json.NET - Json.NET is a popular high-performance JSON framework for .NET

swagger-ui - Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

ZeroFormatter - Infinitely Fast Deserializer for .NET, .NET Core and Unity.

Polly - Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.

Msgpack-Cli - MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]

protobuf-net.Grpc - GRPC bindings for protobuf-net and grpc-dotnet

Utf8Json - Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).