-
Notifications
You must be signed in to change notification settings - Fork 191
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
Set 'id' field when deserializing a PutPipelineRequest #790
Open
patschl
wants to merge
1
commit into
opensearch-project:main
Choose a base branch
from
patschl:put_pipeline_request_id_deserialization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patschl the
PutPipelineRequest
does not includeid
as the payload - it is part of the URL and passed as the URL path component. Under which circumstances it is returned in the request payload? Could you please share the example? (sadly the linked issue has no payload sample).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @reta!
I'm not quite sure I understand the purpose of this deserializer correctly if it should strictly deal with the payload of a request.
id
is a required field for thePutPipelineRequest
, so deserializing will currently fail every time, since the deserializer of course does not set it. Wouldn't this make the deserializer unnecessary if it won't work anyway?We had a similar issue with the
name
property in thePutIndexTemplateRequest
, but managed to work around it.We persist such index template and pipeline definitions as json in our VCS and create the requests using the objects
_DESERIALIZER
implementations, this is the reason for this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @patschl
The deserializer mirrors serializer: in this particular case, the
id
is not part of the serialized JSON (payload) and as such, should not be deserialized from the payload (since it should not be there in the first place).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reta Okay I see, I will close this PR then. Thank you for clearing that up.
There is no way to create this object from a json using this deserializer, but I guess this was never the use case anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @patschl, I think the question is under which circumstances it should happen, this is a request which naturally only uses one way serialization (when send to the service). But in general - yes, it seems like some models may need more context (URI components) to deserialize completely.