diff --git a/README.md b/README.md index 017f378a8137b41e286d9d047465b65260852a0a..c128eb832b764806b929ed71930a42a8aaf3ee47 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ flowchart LR ### API Documentation The API Documentation is accessible at `/swagger-ui` path in OAS 3.0 format. -Example: `localhost:8080/swagger-ui` +Example: `http://localhost:8080/swagger-ui` -### Prerequisites +### Dependencies There must be a running instance of [Redis](https://redis.io/) visible to the service. The address, username and password of the Redis in-memory store instance must be provided as environment variables. diff --git a/design/design.go b/design/design.go index 597055d585e219788abfdbe9437cb4cf397971a5..5ac91e87e715bbdbd1946381a1eaabda5b9dc4a2 100644 --- a/design/design.go +++ b/design/design.go @@ -64,7 +64,7 @@ var _ = Service("cache", func() { }) Method("Set", func() { - Description("Set value in the cache. The HTTP request body is stored as value and the key is assembled from HTTP request headers.") + Description("Set a JSON value in the cache.") Payload(CacheSetRequest) Result(Empty) diff --git a/internal/service/cache/service.go b/internal/service/cache/service.go index 3e89fe1e5725e096b0f28cbd9cb166e296faece8..ee824a4c989d4542273e2f334d20e62c1c852a76 100644 --- a/internal/service/cache/service.go +++ b/internal/service/cache/service.go @@ -53,7 +53,7 @@ func (s *Service) Get(ctx context.Context, req *cache.CacheGetRequest) ([]byte, func (s *Service) Set(ctx context.Context, req *cache.CacheSetRequest) error { var operation = zap.String("operation", "set") - if req.Key == "" || req.Namespace == "" || req.Scope == "" || len(req.Data.(map[string]interface{})) == 0 { + if req.Key == "" || req.Namespace == "" || req.Scope == "" { s.logger.Error("bad request: missing key or namespace or scope or data", operation) return errors.New(errors.BadRequest, "bad request") }