fern VS zod

Compare fern vs zod and see what are their differences.

zod

TypeScript-first schema validation with static type inference (by colinhacks)
SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
fern zod
29 292
2,355 30,630
3.4% -
9.9 9.1
6 days ago 6 days ago
TypeScript TypeScript
MIT License MIT License
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.

fern

Posts with mentions or reviews of fern. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-24.
  • The Stainless SDK Generator
    10 projects | news.ycombinator.com | 24 Apr 2024
    Lots of these have been popping up lately, they all seem really good.

    https://buildwithfern.com/

  • Fern: Toolkit to generate SDKs and Docs for your API
    1 project | news.ycombinator.com | 3 Apr 2024
  • Ask HN: Who is hiring? (December 2023)
    17 projects | news.ycombinator.com | 1 Dec 2023
    Fern | https://buildwithfern.com | Founding Backend Engineer | $160k + equity | On-site NYC | Full-time

    At Fern, we're creating the modern developer experience platform. We work with developer-focused companies to generate SDKs & API documentation. We're looking for a Founding Backend Engineer to help us scale with our users. You'll join a small team (3 of us) and will be a product owner who designs, builds, and ships weekly.

    Learn more at https://www.buildwithfern.com/careers

  • Ask HN: Who is hiring? (November 2023)
    15 projects | news.ycombinator.com | 1 Nov 2023
    Fern (YC W23) | Founding Engineer | New York City | $130k-$160k + 0.5-1.0% equity | Full Time | Open Source | https://buildwithfern.com

    REST APIs underpin the internet but are still painful to work with. They are often untyped, unstandardized, and out-of-sync across multiple sources of truth. With Fern, we aim to bring great developer experiences to REST APIs.

    Our stack is Next.js + Vercel, Express (Node.js) + FastAPI (Python), Postgres DB + Prisma ORM, and AWS CDK. We're open source: https://www.github.com/fern-api/fern

    We closed a Seed this year from top-tier US investors, including Y Combinator, Abhinav Asthana (Postman CEO), Arash Ferdowsi (Dropbox co-founder), and Ian McCrystal (Stripe's Head of Docs).

    Learn more: https://www.buildwithfern.com/careers

  • Fern: Beautiful SDKs and Docs for Your API
    1 project | news.ycombinator.com | 30 Oct 2023
  • Show HN: REST Alternative to GraphQL and tRPC
    8 projects | news.ycombinator.com | 10 Oct 2023
    Thank you for your encouraging words and insights!

    There are indeed popular DSLs and code to openapi solutions out there. Many of which are easy to plug in to the openapi-stack libraries btw!

    I guess I personally always found it frustrating to try to control the generated OpenAPI output using additional tooling and ended up preferring yaml + a visualisation tool as the api design workflow. (e.g. swagger editor)

    But something like https://buildwithfern.com, or using zod as substitute for json schema may indeed be worth a try as a step before emitting openapi.

  • Ask HN: Who is hiring? (October 2023)
    9 projects | news.ycombinator.com | 2 Oct 2023
    Fern (YC W23) | Founding Engineer | New York City | $125k-$175k + equity | Full Time | Open Source | https://buildwithfern.com

    REST APIs underpin the internet but are still painful to work with. They are often untyped, unstandardized, and out-of-sync across multiple sources of truth. With Fern, we aim to bring great developer experiences to REST APIs.

    Our stack is Next.js + Vercel, Express (Node.js) + FastAPI (Python), Postgres DB + Prisma ORM, and AWS CDK.

    We closed a Seed this year from top-tier US investors, including Y Combinator, Abhinav Asthana (Postman CEO), Arash Ferdowsi (Dropbox co-founder), and Ian McCrystal (Stripe's Head of Docs).

    Apply by emailing [email protected]

  • Show HN: Langfuse – Open-source observability and analytics for LLM apps
    5 projects | news.ycombinator.com | 29 Aug 2023
    Hi HN! Langfuse is OSS observability and analytics for LLM applications (repo: https://github.com/langfuse/langfuse, 2 min demo: https://langfuse.com/video; try it yourself: https://langfuse.com/demo)

    Langfuse makes capturing and viewing LLM calls (execution traces) a breeze. On top of this data, you can analyze the quality, cost and latency of LLM apps.

    When GPT-4 dropped, we started building LLM apps – a lot of them! [1, 2] But they all suffered from the same issue: it’s hard to assure quality in 100% of cases and even to have a clear view of user behavior. Initially, we logged all prompts/completions to our production database to understand what works and what doesn’t. We soon realized we needed more context, more data and better analytics to sustainably improve our apps. So we started building a homegrown tool.

    Our first task was to track and view what is going on in production: what user input is provided, how prompt templates or vector db requests work, and which steps of an LLM chain fail. We built async SDKs and a slick frontend to render chains in a nested way. It’s a good way to look at LLM logic ‘natively’. Then we added some basic analytics to understand token usage and quality over time for the entire project or single users (pre-built dashboards).

    Under the hood, we use the T3 stack (Typescript, NextJs, Prisma, tRPC, Tailwind, NextAuth), which allows us to move fast + it means it's easy to contribute to our repo. The SDKs are heavily influenced by the design of the PostHog SDKs [3] for stable implementations of async network requests. It was a surprisingly inconvenient experience to convert OpenAPI specs to boilerplate Python code and we ended up using Fern [4] here. We’re fans of Tailwind + shadcn/ui + tremor.so for speed and flexibility in building tables and dashboards fast.

    Our SDKs run fully asynchronously and make network requests in the background. We did our best to reduce any impact on application performance to a minimum. We never block the main execution path.

    We've made two engineering decisions we've felt uncertain about: to use a Postgres database and Looker Studio for the analytics MVP. Supabase performs well at our scale and integrates seamlessly into our tech stack. We will need to move to an OLAP database soon and are debating if we need to start batching ingestion and if we can keep using Vercel. Any experience you could share would be helpful!

    Integrating Looker Studio got us to first analytics charts in half a day. As it is not open-source and does not work with our UI/UX, we are looking to switch it out for an OSS solution to flexibly generate charts and dashboards. We’ve had a look at Lightdash and would be happy to hear your thoughts.

    We’re borrowing our OSS business model from Posthog/Supabase who make it easy to self-host with features reserved for enterprise (no plans yet) and a paid version for managed cloud service. Right now all of our code is available under a permissive license (MIT).

    Next, we’re going deep on analytics. For quality specifically, we will build out model-based evaluations and labeling to be able to cluster traces by scores and use cases.

    Looking forward to hearing your thoughts and discussion – we’ll be in the comments. Thanks!

    [1] https://learn-from-ai.com/

    [2] https://www.loom.com/share/5c044ca77be44ff7821967834dd70cba

    [3] https://posthog.com/docs/libraries

    [4] https://buildwithfern.com/

  • tRPC – Move Fast and Break Nothing. End-to-end typesafe APIs made easy
    30 projects | news.ycombinator.com | 12 Aug 2023
    You can recommend it in what context, from openapi (as they claim https://github.com/fern-api/fern#starting-from-openapi ) or from their ... special ... definition schema?

    For those wanting less talk, moar code: https://github.com/fern-api/fern-java/blob/0.4.2-rc3/example... -> https://github.com/fern-api/fern-java/blob/0.4.2-rc3/example...

  • OpenAPI v4 Proposal
    24 projects | news.ycombinator.com | 31 May 2023
    I'm one of the builders of an open source project (buildwithfern.com) to improve client codegen. One of the learnings I've had is that the quality of OpenAPI specs varies widely (like really widely). We wrote a linter that suggests improvements to your OpenAPI before you run the code generators and that's been really helpful for generating idiomatic clients.

    You can try Fern for free: https://buildwithfern.com

zod

Posts with mentions or reviews of zod. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-05-04.
  • Simplifying Form Validation with Zod and React Hook Form
    1 project | dev.to | 4 May 2024
    [Zod Documentation](https://zod.dev/) [Zod Error Handling](https://zod.dev/ERROR_HANDLING?id=error-handling-in-zod) [React-Hook-Form Documentation](https://react-hook-form.com/get-started) [Hookform Resolvers](https://www.npmjs.com/package/@hookform/resolvers)
  • Figma's Journey to TypeScript
    5 projects | news.ycombinator.com | 4 May 2024
    This is a very fair comment, and you seem open to understanding why types are useful.

    "problems that are due to typing" is a very difficult thing to unpack because types can mean _so_ many things.

    Static types are absolutely useless (and, really, a net negative) if you're not using them well.

    Types don't help if you don't spend the time modeling with the type system. You can use the type system to your advantage to prevent invalid states from being represented _at all_.

    As an example, consider a music player that keeps track of the current song and the current position in the song.

    If you model this naively you might do something like: https://gist.github.com/shepherdjerred/d0f57c99bfd69cf9eada4...

    In the example above you _are_ using types. It might not be obvious that some of these issues can be solved with stronger types, that is, you might say that "You rarely see problems that are due to typing".

    Here's an example where the type system can give you a lot more safety: https://gist.github.com/shepherdjerred/0976bc9d86f0a19a75757...

    You'll notice that this kind of safety is pretty limited. If you're going to write a music app, you'll probably need API calls, local storage, URL routes, etc.

    TypeScript's typechecking ends at the "boundaries" of the type system, e.g. it cannot automatically typecheck your fetch or localStorage calls return the correct types. If you're casting, you're bypassing the type systems and making it worthless. Runtime type checking libraries like Zod [0] can take care of this for you and are able to typecheck at the boundaries of your app so that the type system can work _extremely_ well.

    [0]: https://zod.dev/ note: I mentioned Zod because I like it. There are _many_ similar libraries.

  • From Flaky to Flawless: Angular API Response Management with Zod
    1 project | dev.to | 25 Apr 2024
    Zod is an open-source schema declaration and validation library that emphasizes TypeScript. It can refer to any data type, from simple to complex. Zod eliminates duplicative type declarations by inferring static TypeScript types and allows easy composition of complex data structures from simpler ones. It has no dependencies, is compatible with Node.js and modern browsers, and has a concise, chainable interface. Zod is lightweight (8kb when zipped), immutable, with methods returning new instances. It encourages parsing over validation and is not limited to TypeScript but works well with JavaScript as well.
  • TypeScript Essentials: Distinguishing Types with Branding
    2 projects | news.ycombinator.com | 24 Apr 2024
  • You can’t run away from runtime errors using TypeScript
    1 project | dev.to | 10 Apr 2024
    Zod is a TypeScript-first schema declaration and validation library. It helps create schemas for any data type and is very developer-friendly. Zod has the functional approach of "parse, don't validate." It supports coercion in all primitive types.
  • Best Next.js Libraries and Tools in 2024
    10 projects | dev.to | 10 Apr 2024
    Link: https://zod.dev/
  • Popular Libraries For Building Type-safe Web Application APIs
    6 projects | dev.to | 7 Apr 2024
    You can check out their documentation here.
  • Epic Next JS 14 Tutorial Part 4: How To Handle Login And Authentication in Next.js
    1 project | dev.to | 4 Apr 2024
    You can learn more about Zod on their website here.
  • What even is a JSON number?
    4 projects | news.ycombinator.com | 1 Apr 2024
    In JS, it's a good idea anyway to use some JSON parsing library instead of JSON.parse.

    With Zod, you can use z.bigint() parser. If you take the "parse any JSON" snippet https://zod.dev/?id=json-type and change z.number() to z.bigint(), it should do what you are looking for.

  • Error handling in our form component for the NextAuth CredentialsProvider
    2 projects | dev.to | 1 Apr 2024
    We will validate our input using client-side zod. Zod handles TypeScript-first schema validation with static type inference. This means that it will not only validate your fields, it will also set types on validated fields.

What are some alternatives?

When comparing fern and zod 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)

class-validator - Decorator-based property validation for classes.

trpc - 🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.

joi - The most powerful data validation library for JS [Moved to: https://github.com/sideway/joi]

openapi-typescript-codegen - NodeJS library that generates Typescript or Javascript clients based on the OpenAPI specification

typebox - Json Schema Type Builder with Static Type Resolution for TypeScript

speakeasy - Speakeasy CLI - Enterprise developer experience for your API

Yup - Dead simple Object schema validation

electron-trpc - Build type-safe Electron inter-process communication using tRPC

ajv - The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)

openai-node - The official Node.js / Typescript library for the OpenAI API

io-ts - Runtime type system for IO decoding/encoding