JuliusBrussee/caveman · error

request body must contain one JSON value

Error message

request body must contain one JSON value

What it means

Error "request body must contain one JSON value" thrown in JuliusBrussee/caveman.

Source

Thrown at shared/platform/httpx/httpx.go:89

		return "Service temporarily unavailable."
	case http.StatusGatewayTimeout:
		return "Upstream service timed out."
	default:
		return "Internal server error."
	}
}

func DecodeJSON(r *http.Request, dst any, maxBytes int64) error {
	defer r.Body.Close()
	reader := http.MaxBytesReader(nil, r.Body, maxBytes)
	dec := json.NewDecoder(reader)
	dec.DisallowUnknownFields()
	if err := dec.Decode(dst); err != nil {
		return err
	}
	if err := dec.Decode(&struct{}{}); !errors.Is(err, io.EOF) {
		if err == nil {
			return errors.New("request body must contain one JSON value")
		}
		return err
	}
	return nil
}

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Send exactly one JSON value in the request body.

When it happens

Trigger: Thrown at shared/platform/httpx/httpx.go:89 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/950d18c11fac62ef. Report an issue: GitHub.