Is there any equivalent to pydantic, serde, etc?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • validator

    :100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving

  • Go uses zero values to provide sensible default values. It's a design choice. With a quick Google you'll find several libraries such as https://github.com/go-playground/validator or https://github.com/asaskevich/govalidator. I use validator whenever I need to ensure any JSON I unmarshalled is correct.

  • gojsonschema

    An implementation of JSON Schema, draft v4 v6 & v7 - Go language

  • xeipuuv/gojsonschema

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • govalidator

    [Go] Package of validators and sanitizers for strings, numerics, slices and structs

  • Go uses zero values to provide sensible default values. It's a design choice. With a quick Google you'll find several libraries such as https://github.com/go-playground/validator or https://github.com/asaskevich/govalidator. I use validator whenever I need to ensure any JSON I unmarshalled is correct.

  • mapstructure

    Go library for decoding generic map values into native Go structures and vice versa.

  • Maybe https://github.com/mitchellh/mapstructure can do what you want? It has some options for Remainder Values and Omit Empty

  • godantic

    godantic is a Go package that provides functionality for decoding JSON data and validating it against a given object structure. It aims to simplify the process of decoding and validating JSON input in Go applications.

  • https://github.com/GraHms/godantic try this out

  • ozzo-validation

    An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.

  • go-ozzo/ozzo-validation

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts