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

Fix serialization/deserialization of StageSource #195

Merged
merged 2 commits into from Jul 4, 2017

Conversation

Projects
None yet
2 participants
@joschi
Contributor

joschi commented Jul 4, 2017

Some important Jackson annotations were missing from the StageSource class
which prevented proper deserialization via the Graylog REST API.

Fixes #194

Fix serialization/deserialization of StageSource
Some important Jackson annotations were missing from the StageSource class
which prevented proper deserialization via the Graylog REST API.

Fixes #194

@joschi joschi added this to the 2.3.0 milestone Jul 4, 2017

@joschi joschi requested a review from kroepke Jul 4, 2017

@bernd bernd self-assigned this Jul 4, 2017

@bernd

This comment has been minimized.

Member

bernd commented Jul 4, 2017

@joschi When using the payload mentioned in #194 I am getting this error. Is the payload wrong or is there still an issue in the code?

$ curl -ni -X POST -H Content-Type:application/json -d '{"source": "pipeline \"Test\"\nstage 0 match either\nend", "stages": [{"rules": [], "match_all": false, "stage": 0}], "description": "Test", "title": "Test"}' localhost:9000/api/plugins/org.graylog.plugins.pipelineprocessor/system/pipelines/pipeline ; echo
HTTP/1.1 400 Bad Request
X-Graylog-Node-ID: 28164cbe-4ad9-4c9c-a76e-088655aa7889
Content-Type: application/json
Date: Tue, 04 Jul 2017 12:35:00 GMT
Connection: close
Content-Length: 309

{"type":"ApiError","message":"Can not construct instance of org.graylog.plugins.pipelineprocessor.rest.PipelineSource, problem: Should never call 'set' on setterless property\n at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@3fd17179; line: 1, column: 157]"}
@joschi

This comment has been minimized.

Contributor

joschi commented Jul 4, 2017

@bernd The PipelineSource#create() method was missing a parameter for the "stages" field.

@bernd

bernd approved these changes Jul 4, 2017

Works now. LGTM 👍

@bernd bernd merged commit 86c7e69 into master Jul 4, 2017

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
graylog-project/pr Jenkins build graylog-project-pr-snapshot 304 has succeeded
Details

@bernd bernd deleted the issue-194 branch Jul 4, 2017

@bernd bernd removed the ready-for-review label Jul 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment