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

MF-1088 - Remove message payload content type #1121

Merged
merged 4 commits into from
Apr 21, 2020
Merged

MF-1088 - Remove message payload content type #1121

merged 4 commits into from
Apr 21, 2020

Conversation

manuio
Copy link
Contributor

@manuio manuio commented Apr 17, 2020

Signed-off-by: Manuel Imperiale manuel.imperiale@gmail.com

Resolves #1088

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
@manuio manuio requested a review from a team as a code owner April 17, 2020 12:13
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

This looks good, but it will be mandatory that @dusanb94 and @nmarcetic review as well.

Docs will need update, as this breaks the API.

drasko
drasko previously approved these changes Apr 20, 2020
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

func New(contentType string) transformers.Transformer {
return transformer{
format: formats[contentType],
}
}

func (n transformer) Transform(msg broker.Message) (interface{}, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can rename func (n transformer) Transform... to func (t transformer) Transform.... Weird receiver name n is a legacy from Normalizer.

Comment on lines 36 to 38
return transformer{
format: formats[contentType],
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It makes sense to have a default format (also, please rename contentType to contentFormat):

format, ok := formats[contentFormat]
if !ok {
    format = formats[JSON]
}

return transformer {
    format: format,
} 

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
@codecov-io
Copy link

codecov-io commented Apr 20, 2020

Codecov Report

Merging #1121 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1121   +/-   ##
=======================================
  Coverage   75.33%   75.33%           
=======================================
  Files         101      101           
  Lines        6853     6853           
=======================================
  Hits         5163     5163           
  Misses       1333     1333           
  Partials      357      357           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ccbfe20...ba30445. Read the comment docs.

dborovcanin
dborovcanin previously approved these changes Apr 20, 2020
nmarcetic
nmarcetic previously approved these changes Apr 21, 2020
@manuio manuio dismissed stale reviews from nmarcetic and dborovcanin via 761fc67 April 21, 2020 13:39
Copy link
Contributor

@drasko drasko left a comment

Choose a reason for hiding this comment

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

LGTM

@drasko drasko merged commit 7a18d3f into absmach:master Apr 21, 2020
manuio added a commit that referenced this pull request Oct 12, 2020
* MF-1088 - Remove message payload content type

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Add default contentFormat

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
@manuio manuio deleted the ct branch February 23, 2022 12:38
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.

Remove /ct content-type topic extension
6 participants