Skip to content

valuetechdev/huma-go

Repository files navigation

go reference badge

huma-go

Go API client for Huma. It's generated with oapi-codegen

Prerequisites

  1. clientId
  2. clientSecret

Usage

go get github.com/valuetechdev/huma-go
import "github.com/valuetechdev/huma-go"

func yourFunc() error {
	client := huma.New(huma.ClientCredentials{
		ClientId:     "your-id",
		ClientSecret: "your-secret",
	})

	res, err := client.ListUsersWithResponse(context.Background(), &huma.ListUsersParams{})
	if err != nil {
		return fmt.Errorf("failed to search for users: %w", err)
	}

	// Do something with res

	return nil
}

Things to know

  • We convert the original Huma API from OpenAPI 3.1 to OpenAPI 3.0 with OpenAPI Overlay.
  • We alter a lot of the operationId in the original spec for readability in overlay.yaml

About

Huma HR API client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published