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

API: only set default content-type when not set #536

Merged
merged 4 commits into from
Oct 10, 2022

Conversation

pzl
Copy link
Member

@pzl pzl commented Oct 5, 2022

This updates the API methods to only set the default content type (json) when the content-type header has not already been manually specified.

This allows a client to manually specify if they are using a different request body format (e.g. yaml, cbor, smile).

This change is all that was needed to successfully send CBOR from Fleet Server (elastic/fleet-server#1902) into elasticsearch

This (i think) closes #132

@pzl
Copy link
Member Author

pzl commented Oct 6, 2022

FYI the failures here are from some out-of-date API stuff that gets pulled down from make gen-api.

There were a few new files and a couple of parameter updates (and several things moved from experimental to beta). I excluded those things from this PR since they seemed like in-tree updates and chose to kept this PR thematically one-note.

CI didn't like that. Happy to just make an update PR and then rebase this, if that's ok, @Anaethelion

@Anaethelion
Copy link
Contributor

@pzl could you just remove the API generation from the PR and keep only the part within the generator ?
I'll take care of updating the API for main and 8.5 once this is merged!

Copy link
Contributor

@Anaethelion Anaethelion left a comment

Choose a reason for hiding this comment

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

LGTM!

@Anaethelion
Copy link
Contributor

Tests are failing because API is not in sync anymore with tests, merging and backporting as-is. API will be updated in branch depending on their respective versions.

@Anaethelion Anaethelion merged commit 97b6bdb into elastic:main Oct 10, 2022
@pzl pzl mentioned this pull request Nov 9, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do we support CBOR format communicating
2 participants