Categorygithub.com/spaceapi-community/go-spaceapi-validator
repositorypackage
0.2.0
Repository: https://github.com/spaceapi-community/go-spaceapi-validator.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

go-spaceapi-validator

Go Report Card

This is a simple library for golang to validate spaceapi specs

usage

package main

import (
	validator "github.com/spaceapi-community/go-spaceapi-validator"
	"fmt"
	"strconv"
)

func main() {
	fmt.Println("Validate with following commit: " + validator.CommitHash)
	result, err := validator.Validate(`{}`/* spaceapi json you want to validate */)
	
	if err != nil {
		panic(err)
	}
	
	fmt.Println("Provided data is valid: " + strconv.FormatBool(result.Valid))
	fmt.Println(result.Errors)
}

Todo

  • Update schemas.go file when something is pushed into schema respository