wso2 / wso2/api-platform

Improve error messaging when referencing a non-existent policy

Open
#960 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type/Improvement
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Current Limitation

When i add a non existing policy to the api and try to create it i am getting this error

Error: expected body to contain "spec.policies[0].name", got: {"errors":[{"field":"spec.policies[0].version","message":"policy 'policy-does-not-exist' major version 'v0' not found in loaded policy definitions"}],"message":"Configuration validation failed","statu...

which is wrong, it should mention that the particular policy is not loaded instead of version not exists.

Suggested Improvement

Fix the validation response

Version

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the API create request with a reference to a policy that is not loaded, then trace the validation response that reports the missing policy's version. Done means the response identifies the policy as not loaded and no longer reports a misleading missing version.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.