Solve a Software Engineering Problem

You're about to solve a real-world coding challenge sourced from an open-source repository that's been enhanced by a fellow Shipd problem creator. Your task is to implement a fix or feature that makes all the provided tests pass.

Your Workflow

  1. Review the problem — Read the description below to understand what you're solving.
  2. Work locally — Set up the repository and implement your solution on your machine.
  3. Run tests — Make sure all provided tests pass.
  4. Submit your patch — Once your solution works, generate a patch file and upload.

Solve Problem

Schema Validation

hairyhenderson/gomplate

Implement a schema validation feature to enforce data structure constraints. The system should verify that input data conforms to a provided JSON Schema, returning an error if validation fails.

Requirements

  • Create a factory function CreateSchemaFuncs(ctx context.Context) map[string]any
  • The map must contain a key "schemas" mapped to a function with signature func() any
  • The object must have a method Validate(schema, input any) (string, error)
  • Return empty string on success to ensure support for standard schema draft versions