Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] XContentType to parse Accept or Content-Type headers #3077

Conversation

nknize
Copy link
Collaborator

@nknize nknize commented Apr 26, 2022

Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.

relates #3035

@nknize nknize added enhancement Enhancement or improvement to existing feature or request non-issue bugs / unexpected behaviors that end up non issues; audit trail simple changes that aren't issues Clients Clients within the Core repository such as High level Rest client and low level client v3.0.0 Issues and PRs related to version 3.0.0 labels Apr 26, 2022
@nknize nknize requested review from a team and reta as code owners April 26, 2022 16:31
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success eb53c9c37fcf7a67ae676533ec46fa5dd56ad6fc
Log 4806

Reports 4806

@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure c8a57a2ef6bc1cdb8715fc833680bb666a1a1dc6
Log 4811

Reports 4811

@nknize
Copy link
Collaborator Author

nknize commented Apr 26, 2022

#1793 repeat

* Where:
Build file '/var/CITOOL/workflow/OpenSearch_CI/PR_Checks/Gradle_Check/search/qa/full-cluster-restart/build.gradle' line: 80

* What went wrong:
Execution failed for task ':qa:full-cluster-restart:v2.1.0#oldClusterTest'.
> `node{:qa:full-cluster-restart:v2.1.0-0}` failed to wait for ports files after 120000 MILLISECONDS

@nknize
Copy link
Collaborator Author

nknize commented Apr 26, 2022

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success c8a57a2ef6bc1cdb8715fc833680bb666a1a1dc6
Log 4812

Reports 4812

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

I don't love this parser implementation. IMO it should be a parser that implements rfc7231 to the letter, hopefully coming from a library that has some reliable history/tests.

Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@nknize nknize force-pushed the refactor/xcontentType/FromMediaTypeOrFormat branch from c8a57a2 to fc8cb12 Compare April 27, 2022 16:17
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure fc8cb12
Log 4832

Reports 4832

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure fec3aeb
Log 4834

Reports 4834

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success cbdd280
Log 4836

Reports 4836

@dblock dblock requested a review from reta April 27, 2022 21:09
@nknize nknize added the backport 2.x Backport to 2.x branch label Apr 28, 2022
@nknize nknize merged commit d86c88f into opensearch-project:main Apr 28, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 28, 2022
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
(cherry picked from commit d86c88f)
nknize added a commit that referenced this pull request Apr 28, 2022
Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
(cherry picked from commit d86c88f)
nknize added a commit that referenced this pull request Apr 29, 2022
… (#3103)

Refactors XContentType.fromMediaTypeOrFormat to fromMediaType so Accept headers
and Content-Type headers can be parsed separately. This helps in reusing the
same parse logic in for REST Versioning API support.

Signed-off-by: Nicholas Walter Knize <nknize@apache.org>
(cherry picked from commit d86c88f)

Co-authored-by: Nick Knize <nknize@apache.org>
dblock added a commit to dblock/opensearch-java that referenced this pull request Jul 20, 2022
See opensearch-project/OpenSearch#3077.

Signed-off-by: dblock <dblock@amazon.com>
dblock added a commit to opensearch-project/opensearch-java that referenced this pull request Jul 20, 2022
* Upgraded to opensearch-rest-client 2.1.0.

Signed-off-by: dblock <dblock@amazon.com>

* Renamed to fromMediaType.

See opensearch-project/OpenSearch#3077.

Signed-off-by: dblock <dblock@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch Clients Clients within the Core repository such as High level Rest client and low level client enhancement Enhancement or improvement to existing feature or request non-issue bugs / unexpected behaviors that end up non issues; audit trail simple changes that aren't issues v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants