Repository navigation
Throw a 400 error for malformed parsing input when missing element end - #145777
carlosdelest merged 5 commits into
Conversation
… parsing exception instead of a server IllegalStateException
|
Hi @carlosdelest, I've created a changelog YAML for you. |
🔍 Preview links for changed docs⏳ Building and deploying preview... View progress This comment will be updated with preview links when the build is complete. |
ℹ️ Important: Docs version tagging👋 Thanks for updating the docs! Just a friendly reminder that our docs are now cumulative. This means all 9.x versions are documented on the same page and published off of the main branch, instead of creating separate pages for each minor version. We use applies_to tags to mark version-specific features and changes. Expand for a quick overviewWhen to use applies_to tags:✅ At the page level to indicate which products/deployments the content applies to (mandatory) What NOT to do:❌ Don't remove or replace information that applies to an older version 🤔 Need help?
|
…n-no-closed-element' into bugfix/parse-exception-when-no-closed-element
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe change modifies how ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
davidkyle
left a comment
There was a problem hiding this comment.
LGTM
For those interested XContentParseException is mapped to a 400 BAD REQUEST status code here
IllegalArgumentExceptions are also 400 status codes. IllegalStateException is the problem because it maps to a 500 status code. IllegalStateException also appears in AbstractObjectParser. I think we should remove that usage too but not necessarily in this PR
We can see suppressed rest errors when an end element is missing from parsing.
Retrievers is one place where this can happen:
This PR changes ObjectParser to throw an XContentParseException in case we're missing an end element (object or array).
Related: